[Libreoffice-commits] .: Branch 'libreoffice-3-4-4' - vcl/unx

Noel Power noelp at kemper.freedesktop.org
Mon Nov 14 03:23:43 PST 2011


 vcl/unx/gtk/app/gtkdata.cxx |   44 +++++++++++++++-----------------------------
 1 file changed, 15 insertions(+), 29 deletions(-)

New commits:
commit d7bcd952360da96271881e776eb74edc55067eb3
Author: Noel Power <noel.power at novell.com>
Date:   Mon Nov 14 11:23:24 2011 +0000

    Revert "fix crash at exit ( access of deleted GtkSalDisplay instance ) bnc#728603"
    
    This reverts commit cdb2e8c531efd22420d8e5df91841bf881f28a7f. Ooops was on the wrong branch

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index a1c8b2f..6a61098 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -576,14 +576,6 @@ GtkXLib::~GtkXLib()
 #endif
     Yield( true, true );
     StopTimer();
-
-    if (m_pUserEvent)
-    {
-        g_source_destroy (m_pUserEvent);
-        g_source_unref (m_pUserEvent);
-        m_pUserEvent = NULL;
-    }
-
      // sanity check: at this point nobody should be yielding, but wake them
      // up anyway before the condition they're waiting on gets destroyed.
     osl_setCondition( m_aDispatchCondition );
@@ -800,36 +792,30 @@ extern "C"
 
 gboolean GtkXLib::userEventFn(gpointer data)
 {
-
-    gboolean bContinue = FALSE;
+    gboolean bContinue;
     GtkXLib *pThis = (GtkXLib *) data;
+    SalData *pSalData = GetSalData();
 
-    GtkData *pGtkData = static_cast<GtkData*>(GetSalData());
-
-    pGtkData->m_pInstance->GetYieldMutex()->acquire();
+    pSalData->m_pInstance->GetYieldMutex()->acquire();
+    pThis->m_pGtkSalDisplay->EventGuardAcquire();
 
-    if ( pGtkData->GetDisplay() )
+    if( !pThis->m_pGtkSalDisplay->HasMoreEvents() )
     {
-        pThis->m_pGtkSalDisplay->EventGuardAcquire();
-
-        if( !pThis->m_pGtkSalDisplay->HasMoreEvents() )
+        if( pThis->m_pUserEvent )
         {
-            if( pThis->m_pUserEvent )
-            {
-                g_source_unref (pThis->m_pUserEvent);
-                pThis->m_pUserEvent = NULL;
-            }
-            bContinue = FALSE;
+            g_source_unref (pThis->m_pUserEvent);
+            pThis->m_pUserEvent = NULL;
         }
-        else
-            bContinue = TRUE;
+        bContinue = FALSE;
+    }
+    else
+        bContinue = TRUE;
 
-        pThis->m_pGtkSalDisplay->EventGuardRelease();
+    pThis->m_pGtkSalDisplay->EventGuardRelease();
 
-        pThis->m_pGtkSalDisplay->DispatchInternalEvent();
+    pThis->m_pGtkSalDisplay->DispatchInternalEvent();
 
-        pGtkData->m_pInstance->GetYieldMutex()->release();
-    }
+    pSalData->m_pInstance->GetYieldMutex()->release();
 
     return bContinue;
 }


More information about the Libreoffice-commits mailing list