[nostalgia/core/sdl] Make only destroy textures that actually exist

This commit is contained in:
Gary Talent 2020-08-07 01:03:24 -05:00
parent 3a339ea191
commit 88bbcc34e2

View File

@ -62,8 +62,10 @@ ox::Error initGfx(Context *ctx) {
ox::Error shutdownGfx(Context *ctx) { ox::Error shutdownGfx(Context *ctx) {
auto id = ctx->implData<SdlImplData>(); auto id = ctx->implData<SdlImplData>();
for (auto tex : id->bgTextures) { for (auto tex : id->bgTextures) {
if (tex) {
SDL_DestroyTexture(tex); SDL_DestroyTexture(tex);
} }
}
SDL_DestroyRenderer(id->renderer); SDL_DestroyRenderer(id->renderer);
SDL_DestroyWindow(id->window); SDL_DestroyWindow(id->window);
delete id; delete id;