[Libreoffice-commits] .: Branch 'libreoffice-3-3' - sfx2/source

David Tardon dtardon at kemper.freedesktop.org
Tue Nov 23 01:38:01 PST 2010


 sfx2/source/appl/shutdowniconunx.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 4c645168924f7115a3dd8c9fdaac6a1a6167a0a7
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Nov 23 10:36:26 2010 +0100

    Related: rhbz#650170 don't crash when quickstarter is exited by user

diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index 3bb5b77..c28e73a 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -409,8 +409,17 @@ void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
     ::SolarMutexGuard aGuard;
     if( !pTrayIcon )
         return;
-    gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
+
+    /* we have to set pTrayIcon to NULL now, because gtk_widget_destroy
+     * causes calling exit_quickstarter_cb (which then calls this func.)
+     * again -> crash.
+     * As an alternative, we could deregister the "destroy" signal here,
+     * but this is simpler .-)
+     */
+    GtkWidget* const pIcon = GTK_WIDGET( pTrayIcon );
     pTrayIcon = NULL;
+	gtk_widget_destroy( pIcon );
+
     pExitMenuItem = NULL;
     pOpenMenuItem = NULL;
     pDisableMenuItem = NULL;


More information about the Libreoffice-commits mailing list