diff --git a/docs/changes.txt b/docs/changes.txt index 35ba62c97e..07d15bba21 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -141,7 +141,10 @@ wxMSW: - Worked around child window and caret positioning bug (in Windows) when using wxBORDER_THEME in a container window. - Suppressed spurious character event for decimal key in numeric keypad. - + +wxGTK: + +- Don't access a possibly destroyed timer object from GTK callback (Tim Kosse). wxMac: diff --git a/src/gtk/timer.cpp b/src/gtk/timer.cpp index 3b132f0a3b..499911d75b 100644 --- a/src/gtk/timer.cpp +++ b/src/gtk/timer.cpp @@ -30,7 +30,8 @@ static gint timeout_callback( gpointer data ) // Don't change the order of anything in this callback! - if (timer->IsOneShot()) + const bool oneshot = timer->IsOneShot(); + if ( oneshot ) { // This sets m_tag to -1 timer->Stop(); @@ -50,7 +51,7 @@ static gint timeout_callback( gpointer data ) if (app) app->WakeUpIdle(); - if (timer->IsOneShot()) + if ( oneshot ) return FALSE; return TRUE; diff --git a/src/gtk1/timer.cpp b/src/gtk1/timer.cpp index c5e8bd37ad..5cf561a6be 100644 --- a/src/gtk1/timer.cpp +++ b/src/gtk1/timer.cpp @@ -29,7 +29,8 @@ static gint timeout_callback( gpointer data ) // Don't change the order of anything in this callback! - if (timer->IsOneShot()) + const bool oneshot = timer->IsOneShot(); + if ( oneshot ) { // This sets m_tag to -1 timer->Stop(); @@ -45,7 +46,7 @@ static gint timeout_callback( gpointer data ) // Release lock again. gdk_threads_leave(); - if (timer->IsOneShot()) + if ( oneshot ) return FALSE; return TRUE;