Fix some memory leaks
This commit is contained in:
parent
8b80942b16
commit
c5cc1870f3
@ -1682,6 +1682,9 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
|
||||
this->g = g;
|
||||
this->sim = sim;
|
||||
|
||||
memset(fire_r, 0, sizeof(fire_r));
|
||||
memset(fire_g, 0, sizeof(fire_g));
|
||||
memset(fire_b, 0, sizeof(fire_b));
|
||||
prepare_alpha(CELL, 1.0f);
|
||||
init_display_modes();
|
||||
prepare_graphicscache();
|
||||
|
@ -118,7 +118,7 @@ void GameController::DrawPoints(queue<ui::Point*> & pointQueue)
|
||||
|
||||
void GameController::Tick()
|
||||
{
|
||||
gameModel->GetSimulation()->update_particles();
|
||||
//gameModel->GetSimulation()->update_particles();
|
||||
}
|
||||
|
||||
void GameController::SetPaused(bool pauseState)
|
||||
|
@ -54,6 +54,8 @@ GameModel::~GameModel()
|
||||
}
|
||||
delete sim;
|
||||
delete ren;
|
||||
if(activeTool)
|
||||
delete activeTool;
|
||||
}
|
||||
|
||||
Brush * GameModel::GetBrush()
|
||||
|
@ -35,7 +35,6 @@ void LoginController::Exit()
|
||||
if(ui::Engine::Ref().GetWindow() == loginView)
|
||||
{
|
||||
ui::Engine::Ref().CloseWindow();
|
||||
loginView = NULL;
|
||||
}
|
||||
if(callback)
|
||||
callback->ControllerExit();
|
||||
|
@ -3185,18 +3185,23 @@ Simulation::Simulation():
|
||||
int menuCount;
|
||||
menu_section * msectionsT = LoadMenus(menuCount);
|
||||
memcpy(msections, msectionsT, menuCount * sizeof(menu_section));
|
||||
free(msectionsT);
|
||||
|
||||
int wallCount;
|
||||
wall_type * wtypesT = LoadWalls(wallCount);
|
||||
memcpy(wtypes, wtypesT, wallCount * sizeof(wall_type));
|
||||
free(wtypesT);
|
||||
|
||||
int elementCount;
|
||||
part_type * ptypesT = LoadElements(elementCount);
|
||||
memcpy(ptypes, ptypesT, elementCount * sizeof(part_type));
|
||||
free(ptypesT);
|
||||
|
||||
int transitionCount;
|
||||
part_transition * ptransitionsT = LoadTransitions(transitionCount);
|
||||
memcpy(ptransitions, ptransitionsT, sizeof(part_transition) * transitionCount);
|
||||
free(ptransitionsT);
|
||||
|
||||
init_can_move();
|
||||
clear_sim();
|
||||
}
|
||||
|
Reference in New Issue
Block a user