diff options
author | Filippos Karapetis | 2008-06-09 14:36:58 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-06-09 14:36:58 +0000 |
commit | 661e507772f4f5aadb9fe35468cc105e4232a8bc (patch) | |
tree | a1184dbed4e1e1c2372079e87290da07f210aca8 /engines/drascula | |
parent | 9e9c38c68939f59b6e577a8225e38235f5ae2f45 (diff) | |
download | scummvm-rg350-661e507772f4f5aadb9fe35468cc105e4232a8bc.tar.gz scummvm-rg350-661e507772f4f5aadb9fe35468cc105e4232a8bc.tar.bz2 scummvm-rg350-661e507772f4f5aadb9fe35468cc105e4232a8bc.zip |
Properly initialize and destroy the different arrays read from drascula.dat. Also, fixed a crash that occurred from the last commit
svn-id: r32635
Diffstat (limited to 'engines/drascula')
-rw-r--r-- | engines/drascula/drascula.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 32ece3cd8a..65a8c4d2f3 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -72,6 +72,20 @@ DrasculaEngine::~DrasculaEngine() { delete _rnd; free(_charMap); + free(_itemLocations); + free(_polX); + free(_polY); + free(_verbBarX); + free(_x1d_menu); + free(_y1d_menu); + free(_frameX); + free(_candleX); + free(_candleY); + free(_pianistX); + free(_drunkX); + free(_roomPreUpdates); + free(_roomUpdates); + free(_roomActions); freeTexts(_text); freeTexts(_textd); freeTexts(_textb); @@ -118,6 +132,20 @@ int DrasculaEngine::init() { } _charMap = 0; + _itemLocations = 0; + _polX = 0; + _polY = 0; + _verbBarX = 0; + _x1d_menu = 0; + _y1d_menu = 0; + _frameX = 0; + _candleX = 0; + _candleY = 0; + _pianistX = 0; + _drunkX = 0; + _roomPreUpdates = 0; + _roomUpdates = 0; + _roomActions = 0; _text = 0; _textd = 0; _textb = 0; @@ -930,7 +958,7 @@ char ***DrasculaEngine::loadTexts(Common::File &in) { res[lang] = (char **)malloc(sizeof(char *) * numTexts); res[lang][0] = pos = (char *)malloc(entryLen); - res[lang][0] = pos + DATAALIGNMENT; + res[lang][0] = pos = pos + DATAALIGNMENT; in.read(res[lang][0], entryLen); |