Skip to content

Commit

Permalink
Textures need to be freed before renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 19, 2013
1 parent 48cffe3 commit d75498f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/test/SDL_test_common.c
Expand Up @@ -951,7 +951,7 @@ SDLTest_PrintEvent(SDL_Event * event)
{
if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
/* Mouse and finger motion are really spammy */
return;
//return;
}

fprintf(stderr, "SDL EVENT: ");
Expand Down Expand Up @@ -1416,14 +1416,6 @@ SDLTest_CommonQuit(SDLTest_CommonState * state)
int i;

SDL_free(state->windows);
if (state->renderers) {
for (i = 0; i < state->num_windows; ++i) {
if (state->renderers[i]) {
SDL_DestroyRenderer(state->renderers[i]);
}
}
SDL_free(state->renderers);
}
if (state->targets) {
for (i = 0; i < state->num_windows; ++i) {
if (state->targets[i]) {
Expand All @@ -1432,6 +1424,14 @@ SDLTest_CommonQuit(SDLTest_CommonState * state)
}
SDL_free(state->targets);
}
if (state->renderers) {
for (i = 0; i < state->num_windows; ++i) {
if (state->renderers[i]) {
SDL_DestroyRenderer(state->renderers[i]);
}
}
SDL_free(state->renderers);
}
if (state->flags & SDL_INIT_VIDEO) {
SDL_VideoQuit();
}
Expand Down

0 comments on commit d75498f

Please sign in to comment.