avoid infinite loop in AlwaysYield() if we somehow got WM_PAINT in the queue (patch 1501682)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d595fb29c9
commit
686ecd1557
@ -41,9 +41,17 @@
|
|||||||
|
|
||||||
void wxConsoleAppTraits::AlwaysYield()
|
void wxConsoleAppTraits::AlwaysYield()
|
||||||
{
|
{
|
||||||
|
// we need to use special logic to deal with WM_PAINT: as this pseudo
|
||||||
|
// message is generated automatically as long as there are invalidated
|
||||||
|
// windows belonging to this thread, we'd never return if we waited here
|
||||||
|
// until we have no more of them left. OTOH, this message is always the
|
||||||
|
// last one in the queue, so we can safely return as soon as we detect it
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
|
while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
|
||||||
;
|
{
|
||||||
|
if ( msg.message == WM_PAINT )
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *wxConsoleAppTraits::BeforeChildWaitLoop()
|
void *wxConsoleAppTraits::BeforeChildWaitLoop()
|
||||||
|
Loading…
Reference in New Issue
Block a user