summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPatrick Luby <plubius@libreoffice.org>2024-01-10 19:30:17 -0500
committerAndras Timar <andras.timar@collabora.com>2024-01-15 16:27:15 +0100
commit16bb30098f4dd2013ca2cd87e53d423479f2c35c (patch)
tree205ee89a8a1dd625718d5bd4037ad00be70bd600 /vcl
parentb499d539ea320cef6e916674c338ff90168e1068 (diff)
tdf#159089 dispose custom accessible here and unset for `m_xDrawingArea`
rather than waiting for `m_xDrawingArea` to get disposed, to prevent unsafe use of the now potentially non-functional accessible until it gets disposed with the VclDrawingArea Change-Id: I5b8720ac4d5ed41cb1775b0142b17d198e9f036d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161903 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@libreoffice.org> (cherry picked from commit 244bd399732017615bab2c34c2b29d6a80d27ae9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162006 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 17e6435c3fc2..95beb907f6c0 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6340,6 +6340,19 @@ SalInstanceDrawingArea::~SalInstanceDrawingArea()
m_xDrawingArea->SetResizeHdl(Link<const Size&, void>());
m_xDrawingArea->SetPaintHdl(
Link<std::pair<vcl::RenderContext&, const tools::Rectangle&>, void>());
+
+ // tdf#159089 dispose custom accessible here and unset for `m_xDrawingArea`
+ // rather than waiting for `m_xDrawingArea` to get disposed, to prevent
+ // unsafe use of the now potentially non-functional accessible until it
+ // gets disposed with the VclDrawingArea
+ css::uno::Reference<css::accessibility::XAccessible> xAccessible
+ = m_xDrawingArea->GetAccessible();
+ css::uno::Reference<css::lang::XComponent> xComp(xAccessible, css::uno::UNO_QUERY);
+ if (xComp.is())
+ {
+ xComp->dispose();
+ m_xDrawingArea->SetAccessible(nullptr);
+ }
}
OutputDevice& SalInstanceDrawingArea::get_ref_device() { return *m_xDrawingArea->GetOutDev(); }