fixed some mem leaks. Models are only released when program exits so restarting a level results in leaks because they are loaded again.

This commit is contained in:
Linda Andersson 2014-02-27 12:10:40 +01:00
parent 2b8dbee5f6
commit 91d1186c93
3 changed files with 8 additions and 7 deletions

View File

@ -12,7 +12,7 @@
#include "Utilities.h"
#include <Protocols.h>
#include "NetworkClient.h"
#include <GameServerAPI.h>
//#include <GameServerAPI.h>
#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::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;
}

View File

@ -3,7 +3,7 @@
#include <Protocols.h>
#include "NetworkClient.h"
#include "Camera_FPSV2.h"
#include <GameServerAPI.h>
//#include <GameServerAPI.h>
#include "C_Light.h"
#include "C_obj/C_Player.h"
#include "C_obj/C_DynamicObj.h"

View File

@ -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()