mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 15:30:50 +00:00
examples/demo/04-bytepusher: No need to check NULL before destroying things.
This commit is contained in:
parent
7bf3cae02e
commit
f9ddb0bdea
1 changed files with 6 additions and 18 deletions
|
@ -405,24 +405,12 @@ void SDL_AppQuit(void* appstate, SDL_AppResult result) {
|
||||||
}
|
}
|
||||||
if (appstate) {
|
if (appstate) {
|
||||||
BytePusher* vm = (BytePusher*)appstate;
|
BytePusher* vm = (BytePusher*)appstate;
|
||||||
if (vm->audiostream) {
|
SDL_DestroyAudioStream(vm->audiostream);
|
||||||
SDL_DestroyAudioStream(vm->audiostream);
|
SDL_DestroyTexture(vm->rendertarget);
|
||||||
}
|
SDL_DestroyTexture(vm->screentex);
|
||||||
if (vm->rendertarget) {
|
SDL_DestroySurface(vm->screen);
|
||||||
SDL_DestroyTexture(vm->rendertarget);
|
SDL_DestroyRenderer(vm->renderer);
|
||||||
}
|
SDL_DestroyWindow(vm->window);
|
||||||
if (vm->screentex) {
|
|
||||||
SDL_DestroyTexture(vm->screentex);
|
|
||||||
}
|
|
||||||
if (vm->screen) {
|
|
||||||
SDL_DestroySurface(vm->screen);
|
|
||||||
}
|
|
||||||
if (vm->renderer) {
|
|
||||||
SDL_DestroyRenderer(vm->renderer);
|
|
||||||
}
|
|
||||||
if (vm->window) {
|
|
||||||
SDL_DestroyWindow(vm->window);
|
|
||||||
}
|
|
||||||
SDL_free(vm);
|
SDL_free(vm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue