[openoffice.org/f14/master] Resolves: rhbz#650170 quickstarter safeexit

Caolan McNamara caolanm at fedoraproject.org
Sat Nov 20 17:00:16 UTC 2010


commit 32f087682d90eead59a3db0b11fb2aee8f3a1f49
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Nov 20 17:00:11 2010 +0000

    Resolves: rhbz#650170 quickstarter safeexit

 openoffice.org.spec                    |    5 +-
 rhbz650170.quickstarter.safeexit.patch |  110 ++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 1 deletions(-)
---
diff --git a/openoffice.org.spec b/openoffice.org.spec
index e195df5..c204c84 100644
--- a/openoffice.org.spec
+++ b/openoffice.org.spec
@@ -138,6 +138,7 @@ Patch54: turn-script-providers-into-extensions.patch
 Patch55: 0001-Resolves-rhbz-647392-Ensure-autocorrect-doesn-t-cras.patch
 Patch56: 0001-Resolves-rhbz-654203-crash-after-unhandled-exception.patch
 Patch57: qstart.dont-forceenabled-on-post-reg-restart.patch
+Patch58: rhbz650170.quickstarter.safeexit.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1692,6 +1693,7 @@ cp -p %{SOURCE5} external/unowinreg/unowinreg.dll
 %patch55 -p1 -b .rhbz-647392-Ensure-autocorrect-doesn-t-cras.patch
 %patch56 -p1 -b .rhbz-654203-crash-after-unhandled-exception.patch
 %patch57 -p1 -b .qstart.dont-forceenabled-on-post-reg-restart.patch
+%patch58 -p1 -b .rhbz650170.quickstarter.safeexit.patch
 touch scripting/source/pyprov/delzip
 touch scripting/util/provider/beanshell/delzip
 touch scripting/util/provider/javascript/delzip
@@ -3864,9 +3866,10 @@ unopkg remove --shared org.openoffice.legacy.ScriptProviderForPython.zip > /dev/
 %endif
 
 %changelog
-* Fri Nov 19 2010 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-15.3-UNBUILT
+* Sat Nov 20 2010 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-15.3-UNBUILT
 - QuickStarter is being enabled for next-start when a new extension
   is installed/updated.
+- Resolves: rhbz#650170 quickstarter safeexit
 
 * Wed Nov 17 2010 Caolán McNamara <caolanm at redhat.com>- 1:3.3.0-15.2
 - Resolves: rhbz#654203 crash after unhandled exception via 
diff --git a/rhbz650170.quickstarter.safeexit.patch b/rhbz650170.quickstarter.safeexit.patch
new file mode 100644
index 0000000..e186ef2
--- /dev/null
+++ b/rhbz650170.quickstarter.safeexit.patch
@@ -0,0 +1,110 @@
+--- a/framework/inc/services/desktop.hxx	Mon Nov 08 13:19:45 2010 +0100
++++ a/framework/inc/services/desktop.hxx	Tue Nov 09 14:44:54 2010 +0100
+@@ -428,6 +428,8 @@ 
+          */
+         ::sal_Bool impl_closeFrames(::sal_Bool bAllowUI);
+ 
++        sal_Bool impl_terminate();
++
+ 	//-------------------------------------------------------------------------------------------------------------
+ 	//	debug methods
+     //  (should be private everytime!)
+@@ -506,6 +508,8 @@ 
+ 
+         css::uno::Reference< css::frame::XUntitledNumbers > m_xTitleNumberGenerator;
+ 
++        bool m_bTerminating;    // we are in the process of terminating already
++
+ };		//	class Desktop
+ 
+ }		//	namespace framework
+--- a/framework/source/services/desktop.cxx	Mon Nov 08 13:19:45 2010 +0100
++++ a/framework/source/services/desktop.cxx	Tue Nov 09 14:44:54 2010 +0100
+@@ -88,6 +88,7 @@ 
+ //_________________________________________________________________________________________________________________
+ //	includes of other projects
+ //_________________________________________________________________________________________________________________
++#include <cppuhelper/exc_hlp.hxx>
+ #include <cppuhelper/queryinterface.hxx>
+ #include <cppuhelper/typeprovider.hxx>
+ #include <cppuhelper/factory.hxx>
+@@ -269,6 +270,7 @@ 
+         ,   m_xSWThreadManager      (                                               )
+         ,   m_xSfxTerminator        (                                               )
+         ,   m_xTitleNumberGenerator (                                               )
++        ,   m_bTerminating(false)
+ {
+ 	// Safe impossible cases
+ 	// We don't accept all incoming parameter.
+@@ -296,6 +298,39 @@ 
+ sal_Bool SAL_CALL Desktop::terminate()
+     throw( css::uno::RuntimeException )
+ {
++    bool bTerminating(false);
++    {
++        WriteGuard aGuard(m_aLock);
++        bTerminating = m_bTerminating;
++        m_bTerminating = true;
++    }
++    if (bTerminating)
++        return false;
++
++    css::uno::Any aException;
++    sal_Bool bTerminate(false);
++    try
++    {
++        bTerminate = impl_terminate();
++    }
++    catch (const css::uno::RuntimeException& rEx)
++    {
++        aException <<= rEx;
++    }
++
++    {
++        WriteGuard aGuard(m_aLock);
++        m_bTerminating = false;
++    }
++
++    if (aException.hasValue())
++        cppu::throwException(aException);
++
++    return bTerminate;
++}
++
++sal_Bool Desktop::impl_terminate()
++{
+     TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+ 
+     SYNCHRONIZED_START
+--- a/sfx2/source/appl/shutdowniconunx.cxx	Mon Nov 08 13:19:45 2010 +0100
++++ a/sfx2/source/appl/shutdowniconunx.cxx	Tue Nov 09 14:44:54 2010 +0100
+@@ -67,11 +67,14 @@ 
+ 
+ static void exit_quickstarter_cb( GtkWidget * )
+ {
+-	egg_tray_icon_cancel_message (pTrayIcon, 1 );
+-	plugin_shutdown_sys_tray();
+-	//terminate may cause this .so to be unloaded. So we must be hands off
+-	//all calls into this .so after this call
+-	ShutdownIcon::terminateDesktop();
++    if (pTrayIcon)
++    {
++        egg_tray_icon_cancel_message (pTrayIcon, 1 );
++        plugin_shutdown_sys_tray();
++        //terminate may cause this .so to be unloaded. So we must be hands off
++        //all calls into this .so after this call
++        ShutdownIcon::terminateDesktop();
++    }
+ }
+ 
+ static void menu_deactivate_cb( GtkWidget *pMenu )
+@@ -397,6 +400,9 @@ 
+ 	// disable shutdown
+ 	pShutdownIcon->SetVeto( true );
+ 	pShutdownIcon->addTerminateListener();
++
++    g_signal_connect(GTK_WIDGET(pTrayIcon), "destroy",
++            G_CALLBACK(exit_quickstarter_cb), NULL);
+ }
+ 
+ void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()


More information about the scm-commits mailing list