mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Don't allow further operations on properties while we're destroying them
Fixes https://github.com/libsdl-org/SDL/issues/12407
This commit is contained in:
@@ -126,9 +126,10 @@ void SDL_QuitProperties(void)
|
||||
// this can't just DestroyHashTable with SDL_FreeProperties as the destructor, because
|
||||
// other destructors under this might cause use to attempt a recursive lock on SDL_properties,
|
||||
// which isn't allowed with rwlocks. So manually iterate and free everything.
|
||||
SDL_IterateHashTable(SDL_properties, FreeOneProperties, NULL);
|
||||
SDL_DestroyHashTable(SDL_properties);
|
||||
SDL_HashTable *properties = SDL_properties;
|
||||
SDL_properties = NULL;
|
||||
SDL_IterateHashTable(properties, FreeOneProperties, NULL);
|
||||
SDL_DestroyHashTable(properties);
|
||||
|
||||
SDL_SetInitialized(&SDL_properties_init, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user