diff options
| author | jacob1 <jfu614@gmail.com> | 2013-02-25 00:11:37 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-02-25 00:11:37 (GMT) |
| commit | fbf52794e59ede9be4362a8816e0682e41dcf414 (patch) | |
| tree | 3fce05c90530469832f16648a7adf10adb95b6e9 /src/game | |
| parent | b92bd245c8b1311b6cd63171611e47a6468e410f (diff) | |
| download | powder-fbf52794e59ede9be4362a8816e0682e41dcf414.zip powder-fbf52794e59ede9be4362a8816e0682e41dcf414.tar.gz | |
fix even more memory leaks
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/GameController.cpp | 4 | ||||
| -rw-r--r-- | src/game/GameModel.cpp | 4 | ||||
| -rw-r--r-- | src/game/ToolButton.cpp | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index c866805..1e10b0e 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -188,6 +188,10 @@ GameController::~GameController() { delete localBrowser; } + if (options) + { + delete options; + } if(ui::Engine::Ref().GetWindow() == gameView) { ui::Engine::Ref().CloseWindow(); diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 0dbf2f7..423a611 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -179,6 +179,10 @@ GameModel::~GameModel() { delete *iter; } + for(std::vector<QuickOption*>::iterator iter = quickOptions.begin(), end = quickOptions.end(); iter != end; ++iter) + { + delete *iter; + } delete sim; delete ren; if(placeSave) diff --git a/src/game/ToolButton.cpp b/src/game/ToolButton.cpp index aa31b3d..c19f0c6 100644 --- a/src/game/ToolButton.cpp +++ b/src/game/ToolButton.cpp @@ -22,6 +22,7 @@ void ToolButton::OnMouseClick(int x, int y, unsigned int button) void ToolButton::OnMouseUnclick(int x, int y, unsigned int button) { + isButtonDown = false; if(isButtonDown) { if(button == BUTTON_LEFT) @@ -32,7 +33,6 @@ void ToolButton::OnMouseUnclick(int x, int y, unsigned int button) SetSelectionState(2); DoAction(); } - isButtonDown = false; } void ToolButton::Draw(const ui::Point& screenPos) |
