Silently ignore timer events from timers which were just stopped.
An assert in wxTimerWndProc() could be provoked by valid user code which simply started and stopped the timers quickly enough because a WM_TIMER could have been already generated just before we stopped the timer. Simply ignore events from unknown timer under assumption that they must come from the recently stopped ones instead of asserting. Ideally we'd somehow distinguish between the situation described above and the really bogus events which could indicate bugs in wx code or a change in behaviour in a future version of Windows but there is no easy way to do it so for now just settle for not asserting in normal case. Closes #10052. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
db6150d59a
commit
86c6fc77e1
@ -173,15 +173,17 @@ LRESULT APIENTRY _EXPORT wxTimerWndProc(HWND hWnd, UINT message,
|
||||
{
|
||||
wxTimerMap::iterator node = TimerMap().find(wParam);
|
||||
|
||||
wxCHECK_MSG( node != TimerMap().end(), 0, wxT("bogus timer id in wxTimerProc") );
|
||||
if ( node != TimerMap().end() )
|
||||
{
|
||||
wxProcessTimer(*(node->second));
|
||||
|
||||
wxProcessTimer(*(node->second));
|
||||
return 0;
|
||||
}
|
||||
//else: Unknown timer, probably one of our timers that had fired just
|
||||
// before being removed from the timers map by Stop().
|
||||
}
|
||||
else
|
||||
{
|
||||
return ::DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ::DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user