mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 19:04:05 +02:00
Some fixes for memory leaks
This commit is contained in:
@@ -496,6 +496,35 @@ GameView::GameView():
|
|||||||
renderModePresets[9].ColourMode = COLOUR_GRAD;
|
renderModePresets[9].ColourMode = COLOUR_GRAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameView::~GameView()
|
||||||
|
{
|
||||||
|
delete[] renderModePresets;
|
||||||
|
|
||||||
|
if(!colourRSlider->GetParentWindow())
|
||||||
|
delete colourRSlider;
|
||||||
|
|
||||||
|
if(!colourGSlider->GetParentWindow())
|
||||||
|
delete colourGSlider;
|
||||||
|
|
||||||
|
if(!colourBSlider->GetParentWindow())
|
||||||
|
delete colourBSlider;
|
||||||
|
|
||||||
|
if(!colourASlider->GetParentWindow())
|
||||||
|
delete colourASlider;
|
||||||
|
|
||||||
|
if(!colourRValue->GetParentWindow())
|
||||||
|
delete colourRValue;
|
||||||
|
|
||||||
|
if(!colourGValue->GetParentWindow())
|
||||||
|
delete colourGValue;
|
||||||
|
|
||||||
|
if(!colourBValue->GetParentWindow())
|
||||||
|
delete colourBValue;
|
||||||
|
|
||||||
|
if(!colourAValue->GetParentWindow())
|
||||||
|
delete colourAValue;
|
||||||
|
}
|
||||||
|
|
||||||
class GameView::MenuAction: public ui::ButtonAction
|
class GameView::MenuAction: public ui::ButtonAction
|
||||||
{
|
{
|
||||||
GameView * v;
|
GameView * v;
|
||||||
|
@@ -119,6 +119,7 @@ private:
|
|||||||
void disableAltBehaviour();
|
void disableAltBehaviour();
|
||||||
public:
|
public:
|
||||||
GameView();
|
GameView();
|
||||||
|
virtual ~GameView();
|
||||||
|
|
||||||
//Breaks MVC, but any other way is going to be more of a mess.
|
//Breaks MVC, but any other way is going to be more of a mess.
|
||||||
ui::Point GetMousePosition();
|
ui::Point GetMousePosition();
|
||||||
|
@@ -2477,6 +2477,13 @@ unsigned int Renderer::GetColourMode()
|
|||||||
|
|
||||||
Renderer::~Renderer()
|
Renderer::~Renderer()
|
||||||
{
|
{
|
||||||
|
#if !defined(OGLR)
|
||||||
|
#if defined(OGLI)
|
||||||
|
delete[] vid;
|
||||||
|
#endif
|
||||||
|
delete[] persistentVid;
|
||||||
|
delete[] warpVid;
|
||||||
|
#endif
|
||||||
free(graphicscache);
|
free(graphicscache);
|
||||||
free(flm_data);
|
free(flm_data);
|
||||||
free(plasma_data);
|
free(plasma_data);
|
||||||
|
Reference in New Issue
Block a user