- return -1;
- }
-
- if ( !::PeekMessage(msg, 0, 0, 0, PM_REMOVE) )
- {
- wxFAIL_MSG( _T("PeekMessage() should have succeeded") );
-
- return -1;
+ default:
+ wxLogDebug("unexpected MsgWaitForMultipleObjects() return "
+ "value %lu", rc);
+ // fall through
+
+ case WAIT_TIMEOUT:
+ return -1;
+
+ case WAIT_OBJECT_0:
+ if ( !::PeekMessage(msg, 0, 0, 0, PM_REMOVE) )
+ {
+ // somehow it may happen that MsgWaitForMultipleObjects()
+ // returns true but there are no messages -- just treat it
+ // the same as timeout then
+ return -1;
+ }
+ break;