mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-06 17:17:04 +00: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) {
|
||||
BytePusher* vm = (BytePusher*)appstate;
|
||||
if (vm->audiostream) {
|
||||
SDL_DestroyAudioStream(vm->audiostream);
|
||||
}
|
||||
if (vm->rendertarget) {
|
||||
SDL_DestroyTexture(vm->rendertarget);
|
||||
}
|
||||
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_DestroyAudioStream(vm->audiostream);
|
||||
SDL_DestroyTexture(vm->rendertarget);
|
||||
SDL_DestroyTexture(vm->screentex);
|
||||
SDL_DestroySurface(vm->screen);
|
||||
SDL_DestroyRenderer(vm->renderer);
|
||||
SDL_DestroyWindow(vm->window);
|
||||
SDL_free(vm);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user