summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx44
1 files changed, 15 insertions, 29 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index a1c8b2fce1..6a61098b98 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;
}