diff -r 930614179450 src/SDL.c --- a/src/SDL.c Fri Dec 03 16:55:25 2010 -0800 +++ b/src/SDL.c Sun Jan 02 09:21:01 2011 -0500 @@ -33,6 +33,9 @@ #include #endif +/* JGO: for SDL_ThreadsQuit() to avoid mem leak */ +#include "thread/SDL_thread_c.h" + /* Initialization/Cleanup routines */ #if !SDL_JOYSTICK_DISABLED extern int SDL_JoystickInit(void); @@ -232,6 +235,9 @@ surfaces_allocated); } #endif + + SDL_ThreadsQuit(); + #ifdef DEBUG_BUILD printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout); #endif diff -r 930614179450 src/thread/SDL_thread_c.h --- a/src/thread/SDL_thread_c.h Fri Dec 03 16:55:25 2010 -0800 +++ b/src/thread/SDL_thread_c.h Sun Jan 02 09:21:01 2011 -0500 @@ -61,4 +61,7 @@ /* This is the function called to run a thread */ extern void SDL_RunThread(void *data); +/* JGO custom - this is needed at SDL_Quit to avoid a 40B leak when the mutex isn't freed */ +extern void SDL_ThreadsQuit(void); + #endif /* _SDL_thread_c_h */