aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kagerer2009-02-16 21:46:02 +0000
committerFlorian Kagerer2009-02-16 21:46:02 +0000
commit57749fc9af12f2e94db5970b92c917b035fa15b0 (patch)
treed1be6b28a0f56d1936da94d43617a25ce200dcb6
parent2bb7b23748d2f16427ffd454554b08ff759bf446 (diff)
downloadscummvm-rg350-57749fc9af12f2e94db5970b92c917b035fa15b0.tar.gz
scummvm-rg350-57749fc9af12f2e94db5970b92c917b035fa15b0.tar.bz2
scummvm-rg350-57749fc9af12f2e94db5970b92c917b035fa15b0.zip
LOL: fixed invalid memory access
svn-id: r38383
-rw-r--r--engines/kyra/lol.cpp17
-rw-r--r--engines/kyra/lol.h2
2 files changed, 11 insertions, 8 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index c3f41629cb..3bb1565ddc 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -138,6 +138,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy
memset (_doorShapes, 0, 2 * sizeof(uint8*));
_lampOilStatus = _brightness = _lampStatusUnk = 0;
+ _lampStatusSuspended = false;
_tempBuffer5120 = 0;
_tmpData136 = 0;
_cLevelItems = 0;
@@ -189,19 +190,23 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy
LoLEngine::~LoLEngine() {
setupPrologueData(false);
+ gui_resetButtonList();
delete[] _landsFile;
delete[] _levelLangFile;
delete _screen;
+ _screen = 0;
delete _gui;
+ _gui = 0;
delete _tim;
- delete _txt;
-
- delete[] _itemsInPlay;
- delete[] _itemProperties;
+ _tim = 0;
+ delete _txt;
+ _txt = 0;
- delete[] _characters;
+ delete[] _itemsInPlay;
+ delete[] _itemProperties;
+ delete[] _characters;
if (_itemIconShapes) {
for (int i = 0; i < _numItemIconShapes; i++)
@@ -302,8 +307,6 @@ LoLEngine::~LoLEngine() {
delete[] _ingameSoundList[i];
delete[] _ingameSoundList;
}
-
- gui_resetButtonList();
}
Screen *LoLEngine::screen() {
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 5b1dfa0152..9a8ed444ef 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -397,7 +397,7 @@ private:
void gui_initMagicScrollButtons();
void gui_initMagicSubmenu(int charNum);
void gui_initButton(int index, int x = -1);
- void gui_notifyButtonListChanged() { _gui->_buttonListChanged = true; }
+ void gui_notifyButtonListChanged() { if (_gui) _gui->_buttonListChanged = true; }
void assignButtonCallback(Button *button, int index);
Button *_activeButtons;