Controllers should free their callbacks and views
This commit is contained in:
parent
83ccd65b14
commit
5e301ba17c
@ -70,6 +70,11 @@ ConsoleView * ConsoleController::GetView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConsoleController::~ConsoleController() {
|
ConsoleController::~ConsoleController() {
|
||||||
// TODO Auto-generated destructor stub
|
if(ui::Engine::Ref().GetWindow() == consoleView)
|
||||||
|
ui::Engine::Ref().CloseWindow();
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
|
delete consoleModel;
|
||||||
|
delete consoleView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ GameController::~GameController()
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
delete gameModel;
|
delete gameModel;
|
||||||
|
delete gameView;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameView * GameController::GetView()
|
GameView * GameController::GetView()
|
||||||
|
@ -130,6 +130,11 @@ void LocalBrowserController::Exit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LocalBrowserController::~LocalBrowserController() {
|
LocalBrowserController::~LocalBrowserController() {
|
||||||
// TODO Auto-generated destructor stub
|
if(ui::Engine::Ref().GetWindow() == browserView)
|
||||||
|
ui::Engine::Ref().CloseWindow();
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
|
delete localBrowserModel;
|
||||||
|
delete localBrowserView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,5 +49,6 @@ LoginController::~LoginController() {
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
delete loginModel;
|
delete loginModel;
|
||||||
|
delete loginView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,5 +70,8 @@ OptionsController::~OptionsController() {
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
delete model;
|
delete model;
|
||||||
|
delete view;
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,5 +103,8 @@ PreviewController::~PreviewController() {
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
delete previewModel;
|
delete previewModel;
|
||||||
|
delete previewView;
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,5 +64,6 @@ RenderController::~RenderController() {
|
|||||||
if(callback)
|
if(callback)
|
||||||
delete callback;
|
delete callback;
|
||||||
delete renderModel;
|
delete renderModel;
|
||||||
|
delete renderView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ SearchController::~SearchController()
|
|||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
}
|
}
|
||||||
delete searchModel;
|
delete searchModel;
|
||||||
|
delete searchView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchController::DoSearch(std::string query)
|
void SearchController::DoSearch(std::string query)
|
||||||
|
@ -51,5 +51,9 @@ void SSaveController::Exit()
|
|||||||
SSaveController::~SSaveController() {
|
SSaveController::~SSaveController() {
|
||||||
if(ui::Engine::Ref().GetWindow() == ssaveView)
|
if(ui::Engine::Ref().GetWindow() == ssaveView)
|
||||||
ui::Engine::Ref().CloseWindow();
|
ui::Engine::Ref().CloseWindow();
|
||||||
|
delete ssaveModel;
|
||||||
|
delete ssaveView;
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,11 @@ void TagsController::Exit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
TagsController::~TagsController() {
|
TagsController::~TagsController() {
|
||||||
// TODO Auto-generated destructor stub
|
if(ui::Engine::Ref().GetWindow() == tagsView)
|
||||||
|
ui::Engine::Ref().CloseWindow();
|
||||||
|
delete tagsModel;
|
||||||
|
delete tagsView;
|
||||||
|
if(callback)
|
||||||
|
delete callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user