Skip to content

Commit

Permalink
Added an assert to catch init/quit call mismatch that might bite people.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 14, 2013
1 parent e9d2133 commit a7b2db0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SDL.c
Expand Up @@ -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];
}
Expand Down

0 comments on commit a7b2db0

Please sign in to comment.