From a7b2db05cd77c91268b377a810450dc4b5976473 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Oct 2013 19:48:45 -0700 Subject: [PATCH] Added an assert to catch init/quit call mismatch that might bite people. --- src/SDL.c | 2 ++ 1 file changed, 2 insertions(+) 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]; }