Fix double free when destroying event thread for a second time. gsoc2009_unit_tests
authorEdgar Simo <bobbens@gmail.com>
Sat, 11 Jul 2009 19:06:49 +0000
branchgsoc2009_unit_tests
changeset 3726ffe22900a50a
parent 3725 6eca2af6a86b
child 3727 51900b161948
Fix double free when destroying event thread for a second time.
src/events/SDL_events.c
     1.1 --- a/src/events/SDL_events.c	Sat Jul 11 18:54:03 2009 +0000
     1.2 +++ b/src/events/SDL_events.c	Sat Jul 11 19:06:49 2009 +0000
     1.3 @@ -196,7 +196,10 @@
     1.4          SDL_DestroyMutex(SDL_EventLock.lock);
     1.5      }
     1.6  #ifndef IPOD
     1.7 -    SDL_DestroyMutex(SDL_EventQ.lock);
     1.8 +    if (SDL_EventQ.lock) {
     1.9 +        SDL_DestroyMutex(SDL_EventQ.lock);
    1.10 +        SDL_EventQ.lock = NULL;
    1.11 +    }
    1.12  #endif
    1.13  }
    1.14