comphelper/source/misc/accessibleeventnotifier.cxx |    5 +++++
 include/comphelper/accessibleeventnotifier.hxx     |    3 +++
 vcl/source/app/svmain.cxx                          |    3 +++
 3 files changed, 11 insertions(+)

New commits:
commit 1ed765c818af2186e459c5ad0eff24dc39a20d34
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 23 13:44:46 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue May 23 16:04:32 2023 +0200

    tdf#155235 workaround gtk3 accessiblibility crashes on close
    
    we are still working around the problem here, which is that various bit
    are not firing accessibility events when their children change.
    
    So clear the static map in comphelper on shutdown, to prevent crashes
    resulting from objects being kept alive after vcl has shutdown
    
    Change-Id: I3ae216b345a1bb4cb4e3fde3527e4d4aa5968f76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152161
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx 
b/comphelper/source/misc/accessibleeventnotifier.cxx
index 37c9edda2625..9c3b55126bc6 100644
--- a/comphelper/source/misc/accessibleeventnotifier.cxx
+++ b/comphelper/source/misc/accessibleeventnotifier.cxx
@@ -263,6 +263,11 @@ void AccessibleEventNotifier::addEvent( const TClientId 
_nClient, const Accessib
     }
 }
 
+void AccessibleEventNotifier::shutdown()
+{
+    gaClients.clear();
+}
+
 } // namespace comphelper
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibleeventnotifier.hxx 
b/include/comphelper/accessibleeventnotifier.hxx
index 75828cda6319..77be52fb90d9 100644
--- a/include/comphelper/accessibleeventnotifier.hxx
+++ b/include/comphelper/accessibleeventnotifier.hxx
@@ -107,6 +107,9 @@ public:
         const TClientId _nClient,
         const css::accessibility::AccessibleEventObject& _rEvent );
 
+    // to be called at application shutdown to clear the static map, so we 
don't get crashes on shutdown
+    static void shutdown();
+
 };
 
 }   // namespace comphelper
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index ab461912724f..5bccf3e3a0c4 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -27,6 +27,7 @@
 
 #include <desktop/exithelper.h>
 
+#include <comphelper/accessibleeventnotifier.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/asyncnotification.hxx>
 #include <i18nlangtag/mslangid.hxx>
@@ -596,6 +597,8 @@ void DeInitVCL()
     pSVData->maGDIData.maThemeDrawCommandsCache.clear();
     pSVData->maGDIData.maThemeImageCache.clear();
 
+    comphelper::AccessibleEventNotifier::shutdown();
+
     // Deinit Sal
     if (pSVData->mpDefInst)
     {

Reply via email to