mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 23:07:45 +08:00
examples/demo/04-bytepusher: No need to check NULL before destroying things.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user