Don't access possibly deleted wxTimer in GTK callback.
The timer object could be deleted from its Notify(), so don't access it any more after calling it. Just remember whether it was a one shot timer or not and reuse this value for the return value of the callback. Closes #11295. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,6 +142,9 @@ wxMSW:
|
||||
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:
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user