From a9677e47a9160b5219c143fc9fa0a7a21f478dc3 Mon Sep 17 00:00:00 2001 From: Tamir Atias Date: Thu, 12 Apr 2012 22:24:38 +0300 Subject: [PATCH] [Fix] Fixed memory leak in Player. [Fix] Added Actor.h and Actor.cpp to VC++ project. --- Bin/VC10/VC10.vcxproj | 2 ++ Bin/VC10/VC10.vcxproj.filters | 6 ++++++ src/Actor/Player.cpp | 6 ++++++ src/Main/Game.cpp | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Bin/VC10/VC10.vcxproj b/Bin/VC10/VC10.vcxproj index 185b127..4075b76 100644 --- a/Bin/VC10/VC10.vcxproj +++ b/Bin/VC10/VC10.vcxproj @@ -83,6 +83,7 @@ + @@ -124,6 +125,7 @@ + diff --git a/Bin/VC10/VC10.vcxproj.filters b/Bin/VC10/VC10.vcxproj.filters index 2d8e9f1..7599343 100644 --- a/Bin/VC10/VC10.vcxproj.filters +++ b/Bin/VC10/VC10.vcxproj.filters @@ -159,6 +159,9 @@ Actor + + Actor + @@ -254,5 +257,8 @@ Actor + + Actor + \ No newline at end of file diff --git a/src/Actor/Player.cpp b/src/Actor/Player.cpp index e4692be..8c51999 100644 --- a/src/Actor/Player.cpp +++ b/src/Actor/Player.cpp @@ -17,6 +17,12 @@ Player::Player(void) { } Player::~Player(void) { + for(int i = 0; i < 4; i++) { + if(_stepSFX[i]) { + sfxManager.Destroy(_stepSFX[i]); + _stepSFX[i] = NULL; + } + } delete _player; } diff --git a/src/Main/Game.cpp b/src/Main/Game.cpp index 55d429c..215a590 100644 --- a/src/Main/Game.cpp +++ b/src/Main/Game.cpp @@ -93,7 +93,7 @@ void Game::OnResize(int width, int height) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0.0, 800.0, 0.0, 600.0, 0.0, 1.0); + glOrtho(0.0, 800.0, 600.0, 0.0, 0.0, 1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity();