mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 23:48:29 +00:00
Clear the subsystem ref count when shutting down subsystems in the main quit
This prevents dependent subsystems from being deinitialized multiple times
This commit is contained in:
@@ -131,7 +131,11 @@ static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
|
|||||||
{
|
{
|
||||||
const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
|
const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
|
||||||
if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) {
|
if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) {
|
||||||
--SDL_SubsystemRefCount[subsystem_index];
|
if (SDL_bInMainQuit) {
|
||||||
|
SDL_SubsystemRefCount[subsystem_index] = 0;
|
||||||
|
} else {
|
||||||
|
--SDL_SubsystemRefCount[subsystem_index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user