changeset 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 6eca2af6a86b
children 51900b161948
files src/events/SDL_events.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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
 }