]> git.saurik.com Git - wxWidgets.git/commitdiff
Font crash and timer fix as per 2_4.
authorRobert Roebling <robert@roebling.de>
Thu, 19 Jun 2003 19:06:06 +0000 (19:06 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 19 Jun 2003 19:06:06 +0000 (19:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/timer.cpp
src/gtk/window.cpp
src/gtk1/timer.cpp
src/gtk1/window.cpp

index a8514f8cd169098e08cfc5694cc2b6b332396a63..f5330bc0123166c9d03163f7878c20a760991c87 100644 (file)
@@ -30,17 +30,25 @@ extern "C" gint timeout_callback( gpointer data )
 {
     wxTimer *timer = (wxTimer*)data;
 
-    /* when getting called from GDK's timer handler we
-       are no longer within GDK's grab on the GUI
-       thread so we must lock it here ourselves */
+    // Don't change the order of anything in this callback!
+    
+    if (timer->IsOneShot())
+    {
+        // This sets m_tag to -1
+        timer->Stop();
+    }
+    
+    // When getting called from GDK's timer handler we
+    // are no longer within GDK's grab on the GUI
+    // thread so we must lock it here ourselves.
     gdk_threads_enter();
 
     timer->Notify();
 
-    /* release lock again */
+    // Release lock again.
     gdk_threads_leave();
 
-    if ( timer->IsOneShot() )
+    if (timer->IsOneShot())
         return FALSE;
 
     return TRUE;
index 7339c08f0796ea757facaaa25da112f52e1737d9..8ef7d9bfcebb64d29e5db08aa622733ac4f383e2 100644 (file)
@@ -4047,7 +4047,7 @@ void wxWindowGTK::SetWidgetStyle()
     {
 #ifdef __WXGTK20__
         pango_font_description_free( style->font_desc );
-        pango_font_description_copy( m_font.GetNativeFontInfo()->description );
+        style->font_desc = pango_font_description_copy( m_font.GetNativeFontInfo()->description );
 #else
         gdk_font_unref( style->font );
         style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
index a8514f8cd169098e08cfc5694cc2b6b332396a63..f5330bc0123166c9d03163f7878c20a760991c87 100644 (file)
@@ -30,17 +30,25 @@ extern "C" gint timeout_callback( gpointer data )
 {
     wxTimer *timer = (wxTimer*)data;
 
-    /* when getting called from GDK's timer handler we
-       are no longer within GDK's grab on the GUI
-       thread so we must lock it here ourselves */
+    // Don't change the order of anything in this callback!
+    
+    if (timer->IsOneShot())
+    {
+        // This sets m_tag to -1
+        timer->Stop();
+    }
+    
+    // When getting called from GDK's timer handler we
+    // are no longer within GDK's grab on the GUI
+    // thread so we must lock it here ourselves.
     gdk_threads_enter();
 
     timer->Notify();
 
-    /* release lock again */
+    // Release lock again.
     gdk_threads_leave();
 
-    if ( timer->IsOneShot() )
+    if (timer->IsOneShot())
         return FALSE;
 
     return TRUE;
index 7339c08f0796ea757facaaa25da112f52e1737d9..8ef7d9bfcebb64d29e5db08aa622733ac4f383e2 100644 (file)
@@ -4047,7 +4047,7 @@ void wxWindowGTK::SetWidgetStyle()
     {
 #ifdef __WXGTK20__
         pango_font_description_free( style->font_desc );
-        pango_font_description_copy( m_font.GetNativeFontInfo()->description );
+        style->font_desc = pango_font_description_copy( m_font.GetNativeFontInfo()->description );
 #else
         gdk_font_unref( style->font );
         style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );