diff options
author | Peter Kohaut | 2019-02-12 23:04:00 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-02-12 23:07:14 +0100 |
commit | d8eb3c14a488fb7b678aab926de1a0d46ead8a46 (patch) | |
tree | 95b318f8597c8570eaad12481b805817fb4690d1 /engines/bladerunner/script/police_maze.cpp | |
parent | 37e083dcafd4e1243271760974f3671d8a537cf9 (diff) | |
download | scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.tar.gz scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.tar.bz2 scummvm-rg350-d8eb3c14a488fb7b678aab926de1a0d46ead8a46.zip |
BLADERUNNER: Removal of memory leaks
Diffstat (limited to 'engines/bladerunner/script/police_maze.cpp')
-rw-r--r-- | engines/bladerunner/script/police_maze.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/engines/bladerunner/script/police_maze.cpp b/engines/bladerunner/script/police_maze.cpp index b7b627fd63..c45826fc8e 100644 --- a/engines/bladerunner/script/police_maze.cpp +++ b/engines/bladerunner/script/police_maze.cpp @@ -34,7 +34,12 @@ namespace BladeRunner { PoliceMaze::PoliceMaze(BladeRunnerEngine *vm) : ScriptBase(vm) { - reset(); + _isPaused = false; + _isActive = false; + _isEnding = false; + + _pm_var1 = 0; + _pm_var2 = 0; for (int i = 0; i < kNumMazeTracks; i++) { _tracks[i] = new PoliceMazeTargetTrack(vm); @@ -44,22 +49,8 @@ PoliceMaze::PoliceMaze(BladeRunnerEngine *vm) : ScriptBase(vm) { PoliceMaze::~PoliceMaze() { for (int i = 0; i < kNumMazeTracks; i++) { delete _tracks[i]; + _tracks[i] = nullptr; } - - reset(); -} - -void PoliceMaze::reset() { - _isPaused = false; - _isActive = false; - _isEnding = false; - - for (int i = 0; i < kNumMazeTracks; i++) { - _tracks[i] = 0; - } - - _pm_var1 = 0; - _pm_var2 = 0; } void PoliceMaze::clear(bool isLoadingGame) { |