[nostalgia/core/sdl] Make only destroy textures that actually exist
This commit is contained in:
parent
3a339ea191
commit
88bbcc34e2
@ -62,7 +62,9 @@ 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) {
|
||||||
SDL_DestroyTexture(tex);
|
if (tex) {
|
||||||
|
SDL_DestroyTexture(tex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SDL_DestroyRenderer(id->renderer);
|
SDL_DestroyRenderer(id->renderer);
|
||||||
SDL_DestroyWindow(id->window);
|
SDL_DestroyWindow(id->window);
|
||||||
|
Loading…
Reference in New Issue
Block a user