mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-17 22:38:38 +01:00
Some fixes for memory leaks
This commit is contained in:
parent
a8fbd905c2
commit
e34ed89dc3
@ -496,6 +496,35 @@ GameView::GameView():
|
||||
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
|
||||
{
|
||||
GameView * v;
|
||||
|
@ -119,6 +119,7 @@ private:
|
||||
void disableAltBehaviour();
|
||||
public:
|
||||
GameView();
|
||||
virtual ~GameView();
|
||||
|
||||
//Breaks MVC, but any other way is going to be more of a mess.
|
||||
ui::Point GetMousePosition();
|
||||
|
@ -2477,6 +2477,13 @@ unsigned int Renderer::GetColourMode()
|
||||
|
||||
Renderer::~Renderer()
|
||||
{
|
||||
#if !defined(OGLR)
|
||||
#if defined(OGLI)
|
||||
delete[] vid;
|
||||
#endif
|
||||
delete[] persistentVid;
|
||||
delete[] warpVid;
|
||||
#endif
|
||||
free(graphicscache);
|
||||
free(flm_data);
|
||||
free(plasma_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user