[Libreoffice-commits] .: 2 commits - vcl/aqua vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Wed Aug 24 05:54:42 PDT 2011


 vcl/aqua/source/a11y/documentfocuslistener.cxx |    2 -
 vcl/unx/gtk/app/gtkdata.cxx                    |   35 +++++++++++++++----------
 2 files changed, 23 insertions(+), 14 deletions(-)

New commits:
commit cbe995205c20663f4f90ca8e1cea081a313d94e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 24 13:53:27 2011 +0100

    avoid crash on shutdown with unprocessed events pending post SalDisplay dtor

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index dde909f..b68d023 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -859,28 +859,37 @@ extern "C"
 
 gboolean GtkXLib::userEventFn(gpointer data)
 {
-    gboolean bContinue;
+    gboolean bContinue = FALSE;
     GtkXLib *pThis = (GtkXLib *) data;
-    SalData *pSalData = GetSalData();
+    X11SalData *pSalData = GetX11SalData();
 
     pSalData->m_pInstance->GetYieldMutex()->acquire();
-    pThis->m_pGtkSalDisplay->EventGuardAcquire();
 
-    if( !pThis->m_pGtkSalDisplay->HasMoreEvents() )
+    const SalDisplay *pDisplay = pSalData->GetDisplay();
+    //GtkSalDisplay inherits from SalDisplay, SalDisplay's dtor deregisters
+    //itself from  SalData, so use presence of pDisplay here to detect that
+    //m_pGtkSalDisplay was destroyed by X11SalData::DeleteDisplay
+    if (pDisplay)
     {
-        if( pThis->m_pUserEvent )
+        OSL_ASSERT(pThis->m_pGtkSalDisplay == pDisplay);
+        pThis->m_pGtkSalDisplay->EventGuardAcquire();
+
+        if( !pThis->m_pGtkSalDisplay->HasMoreEvents() )
         {
-            g_source_unref (pThis->m_pUserEvent);
-            pThis->m_pUserEvent = NULL;
+            if( pThis->m_pUserEvent )
+            {
+                g_source_unref (pThis->m_pUserEvent);
+                pThis->m_pUserEvent = NULL;
+            }
+            bContinue = FALSE;
         }
-        bContinue = FALSE;
-    }
-    else
-        bContinue = TRUE;
+        else
+            bContinue = TRUE;
 
-    pThis->m_pGtkSalDisplay->EventGuardRelease();
+        pThis->m_pGtkSalDisplay->EventGuardRelease();
 
-    pThis->m_pGtkSalDisplay->DispatchInternalEvent();
+        pThis->m_pGtkSalDisplay->DispatchInternalEvent();
+    }
 
     pSalData->m_pInstance->GetYieldMutex()->release();
 
commit 2c87725f1268f0dd2ae5c3e35475b04f3296ab01
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 24 13:25:47 2011 +0100

    potential WaE

diff --git a/vcl/aqua/source/a11y/documentfocuslistener.cxx b/vcl/aqua/source/a11y/documentfocuslistener.cxx
index 411dd31..b483977 100644
--- a/vcl/aqua/source/a11y/documentfocuslistener.cxx
+++ b/vcl/aqua/source/a11y/documentfocuslistener.cxx
@@ -75,7 +75,7 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
                 if( AccessibleStateType::FOCUSED == nState )
                     m_aFocusTracker.setFocusedObject( getAccessible(aEvent) );
             }
-            catch(const IndexOutOfBoundsException &e)
+            catch(const IndexOutOfBoundsException &)
             {
                 OSL_TRACE("Focused object has invalid index in parent");
             }


More information about the Libreoffice-commits mailing list