diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 423a6112e..260634360 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -183,6 +183,10 @@ GameModel::~GameModel() { delete *iter; } + for(std::vector::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 0fb24a3f6..731f26510 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 26b54bb57..4c9734287 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 f9783c99a..d64ccf7b2 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();