Explorar o código

Added an assert to catch init/quit call mismatch that might bite people.

Sam Lantinga %!s(int64=12) %!d(string=hai) anos
pai
achega
a7b2db05cd
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/SDL.c

+ 2 - 0
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];
     }