diff options
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 6d3b3c4750..c2e0fd20e4 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2656,10 +2656,12 @@ void SurfaceSdlGraphicsManager::notifyResize(const int width, const int height) #if SDL_VERSION_ATLEAST(2, 0, 0) void SurfaceSdlGraphicsManager::deinitializeRenderer() { - SDL_DestroyTexture(_screenTexture); + if (_screenTexture) + SDL_DestroyTexture(_screenTexture); _screenTexture = nullptr; - SDL_DestroyRenderer(_renderer); + if (_renderer) + SDL_DestroyRenderer(_renderer); _renderer = nullptr; } |