Skip to content

Commit

Permalink
Do a final pass freeing temporary memory when we quit.
Browse files Browse the repository at this point in the history
Fixes #10169
  • Loading branch information
slouken committed Jul 4, 2024
1 parent a04596c commit 9d47dae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ void SDL_Quit(void)
*/
SDL_memset(SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount));

SDL_FlushEventMemory(0);

SDL_CleanupTLS();

SDL_FreeEnvironmentMemory();
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const char *SDL_AllocateEventString(const char *string)
return NULL;
}

static void SDL_FlushEventMemory(Uint32 eventID)
void SDL_FlushEventMemory(Uint32 eventID)
{
SDL_LockMutex(SDL_event_memory_lock);
{
Expand Down
1 change: 1 addition & 0 deletions src/events/SDL_events_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/* Start and stop the event processing loop */
extern int SDL_StartEventLoop(void);
extern void SDL_StopEventLoop(void);
extern void SDL_FlushEventMemory(Uint32 eventID);
extern void SDL_QuitInterrupt(void);

extern const char *SDL_AllocateEventString(const char *string);
Expand Down

0 comments on commit 9d47dae

Please sign in to comment.