src/events/SDL_events.c
changeset 7201 c6b3d3c32507
parent 7191 75360622e65f
child 7304 9598cbf46957
--- a/src/events/SDL_events.c	Mon May 20 22:05:49 2013 -0700
+++ b/src/events/SDL_events.c	Mon May 20 23:04:25 2013 -0700
@@ -388,12 +388,11 @@
 void
 SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
 {
-    SDL_Event bitbucket;
-
     /* Set filter and discard pending events */
-    SDL_EventOK = filter;
+    SDL_EventOK = NULL;
+    SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
     SDL_EventOKParam = userdata;
-    while (SDL_PollEvent(&bitbucket) > 0);
+    SDL_EventOK = filter;
 }
 
 SDL_bool