diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index df755f008..352d9e5fe 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -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; diff --git a/src/game/GameView.h b/src/game/GameView.h index efb4895c3..de84e1efe 100644 --- a/src/game/GameView.h +++ b/src/game/GameView.h @@ -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(); diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index ea3c84074..aed78b29b 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -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);