Added an assert to catch init/quit call mismatch that might bite people.
authorSam Lantinga <slouken@libsdl.org>
Sun, 13 Oct 2013 19:48:45 -0700
changeset 7810ab1b92bf0327
parent 7809 fd53b2b2a205
child 7811 9dfcc6bad831
Added an assert to catch init/quit call mismatch that might bite people.
src/SDL.c
     1.1 --- a/src/SDL.c	Sun Oct 13 17:15:43 2013 -0300
     1.2 +++ b/src/SDL.c	Sun Oct 13 19:48:45 2013 -0700
     1.3 @@ -65,6 +65,8 @@
     1.4  SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
     1.5  {
     1.6      int subsystem_index = SDL_MostSignificantBitIndex32(subsystem);
     1.7 +    /* If this assert triggers there is a mismatch between init and quit calls */
     1.8 +    SDL_assert(SDL_SubsystemRefCount[subsystem_index] > 0);
     1.9      if (SDL_SubsystemRefCount[subsystem_index] > 0) {
    1.10          --SDL_SubsystemRefCount[subsystem_index];
    1.11      }