mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Textures need to be freed before renderers
This commit is contained in:
parent
48cffe33f9
commit
d75498f6be
@ -951,7 +951,7 @@ SDLTest_PrintEvent(SDL_Event * event)
|
|||||||
{
|
{
|
||||||
if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
|
if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
|
||||||
/* Mouse and finger motion are really spammy */
|
/* Mouse and finger motion are really spammy */
|
||||||
return;
|
//return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "SDL EVENT: ");
|
fprintf(stderr, "SDL EVENT: ");
|
||||||
@ -1416,14 +1416,6 @@ SDLTest_CommonQuit(SDLTest_CommonState * state)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
SDL_free(state->windows);
|
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) {
|
if (state->targets) {
|
||||||
for (i = 0; i < state->num_windows; ++i) {
|
for (i = 0; i < state->num_windows; ++i) {
|
||||||
if (state->targets[i]) {
|
if (state->targets[i]) {
|
||||||
@ -1432,6 +1424,14 @@ SDLTest_CommonQuit(SDLTest_CommonState * state)
|
|||||||
}
|
}
|
||||||
SDL_free(state->targets);
|
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) {
|
if (state->flags & SDL_INIT_VIDEO) {
|
||||||
SDL_VideoQuit();
|
SDL_VideoQuit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user