diff src/events/SDL_events.c @ 3726:ffe22900a50a gsoc2009_unit_tests

Fix double free when destroying event thread for a second time.
author Edgar Simo <bobbens@gmail.com>
date Sat, 11 Jul 2009 19:06:49 +0000
parents 9da8f57ab92c
children 82ce350be859
line wrap: on
line diff
--- a/src/events/SDL_events.c	Sat Jul 11 18:54:03 2009 +0000
+++ b/src/events/SDL_events.c	Sat Jul 11 19:06:49 2009 +0000
@@ -196,7 +196,10 @@
         SDL_DestroyMutex(SDL_EventLock.lock);
     }
 #ifndef IPOD
-    SDL_DestroyMutex(SDL_EventQ.lock);
+    if (SDL_EventQ.lock) {
+        SDL_DestroyMutex(SDL_EventQ.lock);
+        SDL_EventQ.lock = NULL;
+    }
 #endif
 }