diff --git a/src/SDL.c b/src/SDL.c index d8c05fb5b..b1111159a 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -65,6 +65,8 @@ static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) { int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + /* If this assert triggers there is a mismatch between init and quit calls */ + SDL_assert(SDL_SubsystemRefCount[subsystem_index] > 0); if (SDL_SubsystemRefCount[subsystem_index] > 0) { --SDL_SubsystemRefCount[subsystem_index]; }