mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Fix memleak with CHBLUPI channel
This commit is contained in:
parent
8810e9afa9
commit
d983422866
@ -80,6 +80,9 @@ CPixmap::~CPixmap ()
|
|||||||
if (tex.second.texMask)
|
if (tex.second.texMask)
|
||||||
SDL_DestroyTexture (tex.second.texMask);
|
SDL_DestroyTexture (tex.second.texMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_lpSDLBlupi)
|
||||||
|
SDL_FreeSurface (m_lpSDLBlupi);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cr�e l'objet DirectDraw principal.
|
// Cr�e l'objet DirectDraw principal.
|
||||||
@ -228,7 +231,7 @@ bool CPixmap::Cache (
|
|||||||
std::string file = GetBaseDir () + pFilename;
|
std::string file = GetBaseDir () + pFilename;
|
||||||
SDL_Surface * surface = IMG_Load (file.c_str ());
|
SDL_Surface * surface = IMG_Load (file.c_str ());
|
||||||
|
|
||||||
if (channel == CHBLUPI)
|
if (channel == CHBLUPI && !m_lpSDLBlupi)
|
||||||
m_lpSDLBlupi = surface;
|
m_lpSDLBlupi = surface;
|
||||||
|
|
||||||
SDL_Texture * texture = SDL_CreateTextureFromSurface (g_renderer, surface);
|
SDL_Texture * texture = SDL_CreateTextureFromSurface (g_renderer, surface);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user