[Scummvm-git-logs] scummvm master -> 9bbf7f3f363465765787819de2c93dd97a629bef
csnover
csnover at users.noreply.github.com
Wed Nov 15 18:36:36 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9bbf7f3f36 SDL: Don't pass null pointers to SDL_DestroyTexture/SDL_DestroyRenderer
Commit: 9bbf7f3f363465765787819de2c93dd97a629bef
https://github.com/scummvm/scummvm/commit/9bbf7f3f363465765787819de2c93dd97a629bef
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-11-15T11:36:14-06:00
Commit Message:
SDL: Don't pass null pointers to SDL_DestroyTexture/SDL_DestroyRenderer
SDL does not like this and will raise an assertion when built with
internal SDL assertions turned on. With internal assertions turned
off, it will still call SDL_SetError any time a null pointer is
passed, though it will not raise an assertion or crash.
Changed paths:
backends/graphics/surfacesdl/surfacesdl-graphics.cpp
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 6d3b3c4..c2e0fd2 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;
}
More information about the Scummvm-git-logs
mailing list