diff --git a/src/nostalgia/core/sdl/gfx.cpp b/src/nostalgia/core/sdl/gfx.cpp index f4ebe24f4..09e06eb2a 100644 --- a/src/nostalgia/core/sdl/gfx.cpp +++ b/src/nostalgia/core/sdl/gfx.cpp @@ -62,7 +62,9 @@ ox::Error initGfx(Context *ctx) { ox::Error shutdownGfx(Context *ctx) { auto id = ctx->implData(); for (auto tex : id->bgTextures) { - SDL_DestroyTexture(tex); + if (tex) { + SDL_DestroyTexture(tex); + } } SDL_DestroyRenderer(id->renderer); SDL_DestroyWindow(id->window);