[planetblupi] 04/19: Fix blupi channel memleak
Didier Raboud
odyx at moszumanska.debian.org
Fri Dec 8 09:03:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository planetblupi.
commit 579a74000c4852a9234474dd0b6eec26d22f987a
Author: Mathieu Schroeter <mathieu at schroetersa.ch>
Date: Sun Nov 26 21:57:20 2017 +0100
Fix blupi channel memleak
---
src/pixmap.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/pixmap.cxx b/src/pixmap.cxx
index 52b8a5e..e62fa34 100644
--- a/src/pixmap.cxx
+++ b/src/pixmap.cxx
@@ -228,9 +228,13 @@ CPixmap::Cache (
{
std::string file = GetBaseDir () + pFilename;
SDL_Surface * surface = IMG_Load (file.c_str ());
+ bool blupiChSet = false;
if (channel == CHBLUPI && !m_lpSDLBlupi)
+ {
m_lpSDLBlupi = surface;
+ blupiChSet = true;
+ }
SDL_Texture * texture = SDL_CreateTextureFromSurface (g_renderer, surface);
Uint32 format;
@@ -274,7 +278,7 @@ CPixmap::Cache (
if (!m_SDLTextureInfo[channel].texMask)
SDL_DestroyTexture (texture);
- if (channel != CHBLUPI)
+ if (!blupiChSet)
SDL_FreeSurface (surface);
return true;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/planetblupi.git
More information about the Pkg-games-commits
mailing list