Clear the subsystem ref count when shutting down subsystems in the main quit
This prevents dependent subsystems from being deinitialized multiple timesmain
parent
171ff041d0
commit
c33e4c998d
|
@ -131,8 +131,12 @@ static void SDL_DecrementSubsystemRefCount(Uint32 subsystem)
|
|||
{
|
||||
const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
|
||||
if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) {
|
||||
if (SDL_bInMainQuit) {
|
||||
SDL_SubsystemRefCount[subsystem_index] = 0;
|
||||
} else {
|
||||
--SDL_SubsystemRefCount[subsystem_index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Private helper to check if a system needs init. */
|
||||
|
|
Loading…
Reference in New Issue