{
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;
{
#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 ) );
{
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;
{
#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 ) );