Some fixes for memory leaks

This commit is contained in:
Simon Robertshaw 2012-08-10 23:08:55 +01:00
parent a8fbd905c2
commit e34ed89dc3
3 changed files with 37 additions and 0 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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);