mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-22 00:39:46 +01:00
Fix some leaks
This commit is contained in:
parent
887c1fbf96
commit
dd5c50c94c
3 changed files with 6 additions and 3 deletions
|
@ -177,6 +177,7 @@ void Graphics::Makebfont()
|
|||
font_positions[codepoint] = pos;
|
||||
++pos;
|
||||
}
|
||||
FILESYSTEM_freeMemory(&charmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2821,6 +2822,7 @@ bool Graphics::onscreen(int t)
|
|||
}
|
||||
|
||||
void Graphics::reloadresources() {
|
||||
grphx.destroy();
|
||||
grphx = GraphicsResources();
|
||||
grphx.init();
|
||||
|
||||
|
@ -2831,7 +2833,6 @@ void Graphics::reloadresources() {
|
|||
} \
|
||||
name.clear();
|
||||
|
||||
CLEAR_ARRAY(images)
|
||||
CLEAR_ARRAY(tiles)
|
||||
CLEAR_ARRAY(tiles2)
|
||||
CLEAR_ARRAY(tiles3)
|
||||
|
@ -2849,6 +2850,8 @@ void Graphics::reloadresources() {
|
|||
maketelearray();
|
||||
Makebfont();
|
||||
|
||||
images.clear();
|
||||
|
||||
images.push_back(grphx.im_image0);
|
||||
images.push_back(grphx.im_image1);
|
||||
images.push_back(grphx.im_image2);
|
||||
|
|
|
@ -108,7 +108,7 @@ void GraphicsResources::init(void)
|
|||
}
|
||||
|
||||
|
||||
GraphicsResources::~GraphicsResources(void)
|
||||
void GraphicsResources::destroy(void)
|
||||
{
|
||||
SDL_FreeSurface(im_tiles);
|
||||
SDL_FreeSurface(im_tiles2);
|
||||
|
|
|
@ -7,7 +7,7 @@ class GraphicsResources
|
|||
{
|
||||
public:
|
||||
void init(void);
|
||||
~GraphicsResources(void);
|
||||
void destroy(void);
|
||||
|
||||
SDL_Surface* im_tiles;
|
||||
SDL_Surface* im_tiles2;
|
||||
|
|
Loading…
Reference in a new issue