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:
Vadim Zeitlin 2006-06-25 23:53:53 +00:00
parent d595fb29c9
commit 686ecd1557

View File

@ -41,9 +41,17 @@
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;
while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
;
{
if ( msg.message == WM_PAINT )
break;
}
}
void *wxConsoleAppTraits::BeforeChildWaitLoop()