diff options
author | Torbjörn Andersson | 2015-12-28 10:59:30 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2015-12-28 11:05:36 +0100 |
commit | fe47fec521134ce9997a15f89afe9e588b989c83 (patch) | |
tree | c9ffd7df7105f5865153e1dbd96524cb517f5f4e /engines/lab | |
parent | 54acbdccc619bd70b946b693f70b28316d1d1f28 (diff) | |
download | scummvm-rg350-fe47fec521134ce9997a15f89afe9e588b989c83.tar.gz scummvm-rg350-fe47fec521134ce9997a15f89afe9e588b989c83.tar.bz2 scummvm-rg350-fe47fec521134ce9997a15f89afe9e588b989c83.zip |
LAB: Free the remaining parts of _moveButtonList and _invButtonList
We can't use freeButtonList(), because apparently some of the button
images are shared between the two lists. At least, that's how I
understand it.
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/engine.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index cf6ae71563..93b7cb4324 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -141,6 +141,18 @@ void LabEngine::freeScreens() { delete _invImages[imgIdx]; _invImages[imgIdx] = nullptr; } + + // We can't use freeButtonList() here, because some buttons are shared + // between the two lists. + for (ButtonList::iterator buttonIter = _moveButtonList.begin(); buttonIter != _moveButtonList.end(); ++buttonIter) { + delete *buttonIter; + } + _moveButtonList.clear(); + + for (ButtonList::iterator buttonIter = _invButtonList.begin(); buttonIter != _invButtonList.end(); ++buttonIter) { + delete *buttonIter; + } + _invButtonList.clear(); } void LabEngine::perFlipButton(uint16 buttonId) { |