diff options
author | uruk | 2014-06-17 15:38:24 +0200 |
---|---|---|
committer | uruk | 2014-06-17 15:38:24 +0200 |
commit | 26901479d3e60eed76dfd306988b27408b22e3ee (patch) | |
tree | e6b475c6ee24c5b2e19637c17eede2fefd0618bc /engines | |
parent | 186d90e5b58c09e04f570b51f97a7bd3315dcbde (diff) | |
download | scummvm-rg350-26901479d3e60eed76dfd306988b27408b22e3ee.tar.gz scummvm-rg350-26901479d3e60eed76dfd306988b27408b22e3ee.tar.bz2 scummvm-rg350-26901479d3e60eed76dfd306988b27408b22e3ee.zip |
CGE2: Fix initialization of _posTab.
Fixes a possible memory leak.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2_main.cpp | 1 | ||||
-rw-r--r-- | engines/cge2/hero.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 0fc2d5af71..5fa44531df 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -733,6 +733,7 @@ void CGE2Engine::loadPos() { EncryptedStream file(this, "CGE.HXY"); for (int cav = 0; cav < kSceneMax; cav++) { + _heroTab[0]->_posTab[cav] = new V2D(this); _heroTab[0]->_posTab[cav]->x = file.readSint16LE(); _heroTab[0]->_posTab[cav]->y = file.readSint16LE(); } diff --git a/engines/cge2/hero.h b/engines/cge2/hero.h index 628f7c1580..7ddc871e06 100644 --- a/engines/cge2/hero.h +++ b/engines/cge2/hero.h @@ -52,7 +52,7 @@ struct HeroTab { _pocket[i] = nullptr; _pocPtr = 0; for (int i = 0; i < kSceneMax; i++) - _posTab[i] = new V2D(vm); + _posTab[i] = nullptr; } ~HeroTab() { for (int i = 0; i < kSceneMax; i++) |