[Libreoffice-commits] .: vcl/source
David Tardon
dtardon at kemper.freedesktop.org
Tue Feb 15 03:55:52 PST 2011
vcl/source/app/svmain.cxx | 43 ++++++++++++++++++++++++++++++++++++++++---
1 file changed, 40 insertions(+), 3 deletions(-)
New commits:
commit 27807f776bc5ddd91144da9c8c24b7766998174f
Author: David Tardon <dtardon at redhat.com>
Date: Tue Feb 15 09:19:23 2011 +0100
destroy the VCL UNO wrapper as late as possible
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index d997e93..37091c8 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -331,6 +331,33 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
return TRUE;
}
+namespace
+{
+
+/** Serves for destroying the VCL UNO wrapper as late as possible. This avoids
+ crash at exit in some special cases when a11y is enabled (e.g., when
+ a bundled extension is registered/deregistered during startup, forcing exit
+ while the app is still in splash screen.)
+ */
+class VCLUnoWrapperDeleter : public cppu::WeakImplHelper1<com::sun::star::lang::XEventListener>
+{
+ virtual void SAL_CALL disposing(EventObject const& rSource) throw(RuntimeException);
+};
+
+void
+VCLUnoWrapperDeleter::disposing(EventObject const& /* rSource */)
+ throw(RuntimeException)
+{
+ ImplSVData* const pSVData = ImplGetSVData();
+ if (pSVData && pSVData->mpUnoWrapper)
+ {
+ pSVData->mpUnoWrapper->Destroy();
+ pSVData->mpUnoWrapper = NULL;
+ }
+}
+
+}
+
void DeInitVCL()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -444,11 +471,21 @@ void DeInitVCL()
pSVData->mpDefaultWin = NULL;
}
- // #114285# Moved here from ImplDeInitSVData...
if ( pSVData->mpUnoWrapper )
{
- pSVData->mpUnoWrapper->Destroy();
- pSVData->mpUnoWrapper = NULL;
+ try
+ {
+ Reference<XComponent> const xDesktop(
+ comphelper::createProcessComponent(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
+ UNO_QUERY_THROW)
+ ;
+ xDesktop->addEventListener(new VCLUnoWrapperDeleter());
+ }
+ catch (Exception const&)
+ {
+ // ignore
+ }
}
pSVData->maAppData.mxMSF.clear();
More information about the Libreoffice-commits
mailing list