summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-02-25 03:09:33 (GMT)
committer jacob1 <jfu614@gmail.com>2013-02-25 03:09:33 (GMT)
commit572d099e29135fe059e756059c1ff715ec68474a (patch)
treec6c06df36329ecf0ac7decc56be2aece9e1a0e93 /src
parent27ac5ab75d361e2933172b6ec1c08b6e7076d1f3 (diff)
downloadpowder-572d099e29135fe059e756059c1ff715ec68474a.zip
powder-572d099e29135fe059e756059c1ff715ec68474a.tar.gz
fix a few more memory errors
Diffstat (limited to 'src')
-rw-r--r--src/game/GameModel.cpp4
-rw-r--r--src/interface/Engine.cpp10
-rw-r--r--src/search/SearchController.cpp2
-rw-r--r--src/simulation/Simulation.cpp8
4 files changed, 11 insertions, 13 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 423a611..2606343 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -183,6 +183,10 @@ GameModel::~GameModel()
{
delete *iter;
}
+ for(std::vector<Notification*>::iterator iter = notifications.begin(); iter != notifications.end(); ++iter)
+ {
+ delete *iter;
+ }
delete sim;
delete ren;
if(placeSave)
diff --git a/src/interface/Engine.cpp b/src/interface/Engine.cpp
index 0fb24a3..731f265 100644
--- a/src/interface/Engine.cpp
+++ b/src/interface/Engine.cpp
@@ -116,16 +116,16 @@ int Engine::CloseWindow()
{
if(!windows.empty())
{
+ if (lastBuffer)
+ {
+ free(lastBuffer);
+ lastBuffer = NULL;
+ }
if(!prevBuffers.empty())
{
lastBuffer = prevBuffers.top();
prevBuffers.pop();
}
- else
- {
- free(lastBuffer);
- lastBuffer = NULL;
- }
state_ = windows.top();
windows.pop();
diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp
index 26b54bb..4c97342 100644
--- a/src/search/SearchController.cpp
+++ b/src/search/SearchController.cpp
@@ -88,8 +88,6 @@ void SearchController::Exit()
}
if(callback)
callback->ControllerExit();
- delete callback;
- callback = NULL;
//HasExited = true;
}
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index f9783c9..d64ccf7 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -4918,12 +4918,8 @@ Simulation::Simulation():
memcpy(gmenu, golMenuT, sizeof(gol_menu) * golMenuCount);
free(golMenuT);
- Element_STKM::STKM_init_legs(this, &player, 0);
- player.spwn = 1;
- player.elem = PT_DUST;
- Element_STKM::STKM_init_legs(this, &player2, 0);
- player2.spwn = 1;
- player2.elem = PT_DUST;
+ player.comm = 0;
+ player2.comm = 0;
init_can_move();
clear_sim();