Fixed memory leak if logging is done after SDL_Quit()

If someone calls SDL_Quit(), then runs an SDL function that implicitly initializes TLS or logging, and then calls SDL_Quit() again, we want to make sure we run through the quit process again. Each of the Init/Quit calls are protected against being called multiple times.
This commit is contained in:
Sam Lantinga 2024-07-27 16:26:54 -07:00
parent 82c89c0125
commit f080336fa6
2 changed files with 1 additions and 13 deletions

View file

@ -118,6 +118,7 @@ void SDL_InitLog(void)
void SDL_QuitLog(void)
{
SDL_ResetLogPriorities();
if (log_function_mutex) {
SDL_DestroyMutex(log_function_mutex);
log_function_mutex = NULL;