diff src/video/windib/SDL_dibvideo.c @ 442:b37ce4813ad4

Flush message queue when shutting down video mode on Windows
author Sam Lantinga <slouken@libsdl.org>
date Sat, 17 Aug 2002 19:17:18 +0000
parents a5f60a847a89
children 323c766f5a46
line wrap: on
line diff
--- a/src/video/windib/SDL_dibvideo.c	Sat Aug 17 19:17:01 2002 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Sat Aug 17 19:17:18 2002 +0000
@@ -889,6 +889,16 @@
 #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 @@
 		}
 		DIB_QuitGamma(this);
 		DIB_DestroyWindow(this);
+		FlushMessageQueue();
 
 		SDL_Window = NULL;
 	}