From 91d1186c93c65f90150d00292b47ce02a163c504 Mon Sep 17 00:00:00 2001 From: Linda Andersson Date: Thu, 27 Feb 2014 12:10:40 +0100 Subject: [PATCH] fixed some mem leaks. Models are only released when program exits so restarting a level results in leaks because they are loaded again. --- Code/Game/GameClient/DanBiasGame_Impl.cpp | 10 +++++----- Code/Game/GameClient/GameClientState/GameState.cpp | 2 +- .../GameServer/Implementation/GameSession_General.cpp | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Code/Game/GameClient/DanBiasGame_Impl.cpp b/Code/Game/GameClient/DanBiasGame_Impl.cpp index 91f56a1a..717c4e96 100644 --- a/Code/Game/GameClient/DanBiasGame_Impl.cpp +++ b/Code/Game/GameClient/DanBiasGame_Impl.cpp @@ -12,7 +12,7 @@ #include "Utilities.h" #include #include "NetworkClient.h" -#include +//#include #include "../WindowManager/WindowShell.h" #include "WinTimer.h" @@ -185,11 +185,11 @@ namespace DanBias DanBiasGame::Result DanBiasGame::Update(float deltaTime) { - if( data.serverOwner ) + /*if( data.serverOwner ) { - DanBias::GameServerAPI::ServerUpdate(); + DanBias::GameServerAPI::ServerUpdate(); } - + */ DanBias::Client::GameClientState::ClientState state = DanBias::Client::GameClientState::ClientState_Same; state = data.state->Update( deltaTime ); @@ -264,7 +264,7 @@ namespace DanBias EventHandler::Instance().Clean(); Graphics::API::Clean(); - GameServerAPI::ServerStop(); + //GameServerAPI::ServerStop(); return S_OK; } diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index aeaba3cf..7a26183a 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -3,7 +3,7 @@ #include #include "NetworkClient.h" #include "Camera_FPSV2.h" -#include +//#include #include "C_Light.h" #include "C_obj/C_Player.h" #include "C_obj/C_DynamicObj.h" diff --git a/Code/Game/GameServer/Implementation/GameSession_General.cpp b/Code/Game/GameServer/Implementation/GameSession_General.cpp index 8c746bf2..fe27decc 100644 --- a/Code/Game/GameServer/Implementation/GameSession_General.cpp +++ b/Code/Game/GameServer/Implementation/GameSession_General.cpp @@ -41,7 +41,8 @@ GameSession::GameSession() this->networkTimer.reset(); this->logicTimer.reset(); - memset(&this->description, 0, sizeof(GameDescription)); + // HACK to avoid mem leaks + //memset(&this->description, 0, sizeof(GameDescription)); } GameSession::~GameSession()