Textures need to be freed before renderers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c
index cd4328e..783ee5a 100644
--- a/src/test/SDL_test_common.c
+++ b/src/test/SDL_test_common.c
@@ -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: ");
@@ -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]) {
@@ -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();
}