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:
Sam Lantinga
2025-02-26 08:34:14 -08:00
parent e012573766
commit cf819ca818

View File

@@ -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);
}