Flush message queue when shutting down video mode on Windows

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40443
This commit is contained in:
Sam Lantinga 2002-08-17 19:17:18 +00:00
parent 16a3c5faef
commit da6273a8f0
2 changed files with 22 additions and 0 deletions

View file

@ -889,6 +889,16 @@ int DIB_GetGammaRamp(_THIS, Uint16 *ramp)
#endif /* !NO_GAMMA_SUPPORT */
}
static void FlushMessageQueue()
{
MSG msg;
while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
if ( msg.message == WM_QUIT ) break;
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
void DIB_VideoQuit(_THIS)
{
/* Destroy the window and everything associated with it */
@ -918,6 +928,7 @@ void DIB_VideoQuit(_THIS)
}
DIB_QuitGamma(this);
DIB_DestroyWindow(this);
FlushMessageQueue();
SDL_Window = NULL;
}

View file

@ -2205,6 +2205,16 @@ static int DX5_GetGammaRamp(_THIS, Uint16 *ramp)
#endif /* !IDirectDrawGammaControl_SetGammaRamp */
}
static void FlushMessageQueue()
{
MSG msg;
while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
if ( msg.message == WM_QUIT ) break;
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
void DX5_VideoQuit(_THIS)
{
int i, j;
@ -2246,6 +2256,7 @@ void DX5_VideoQuit(_THIS)
DIB_QuitGamma(this);
if ( SDL_Window ) {
DX5_DestroyWindow(this);
FlushMessageQueue();
}
/* Free our window icon */