diff options
author | Filippos Karapetis | 2014-12-24 23:27:03 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-24 23:27:03 +0200 |
commit | fa2d8d927b353162ac9ee434b4611e03b22246e8 (patch) | |
tree | 881fb10357b6f29691085688ed9a7126d165af43 /engines | |
parent | 75d78c71cc2190ae4afa655d27cdbc35a748f901 (diff) | |
download | scummvm-rg350-fa2d8d927b353162ac9ee434b4611e03b22246e8.tar.gz scummvm-rg350-fa2d8d927b353162ac9ee434b4611e03b22246e8.tar.bz2 scummvm-rg350-fa2d8d927b353162ac9ee434b4611e03b22246e8.zip |
ZVISION: Plug more memory leaks
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/scripting/controls/paint_control.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/scripting/controls/titler_control.cpp | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/engines/zvision/scripting/controls/paint_control.cpp b/engines/zvision/scripting/controls/paint_control.cpp index df06bb814e..62dde3d170 100644 --- a/engines/zvision/scripting/controls/paint_control.cpp +++ b/engines/zvision/scripting/controls/paint_control.cpp @@ -114,12 +114,18 @@ PaintControl::PaintControl(ZVision *engine, uint32 key, Common::SeekableReadStre PaintControl::~PaintControl() { // Clear the state value back to 0 //_engine->getScriptManager()->setStateValue(_key, 0); - if (_paint) + if (_paint) { + _paint->free(); delete _paint; - if (_brush) + } + if (_brush) { + _brush->free(); delete _brush; - if (_bkg) + } + if (_bkg) { + _bkg->free(); delete _bkg; + } } bool PaintControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { diff --git a/engines/zvision/scripting/controls/titler_control.cpp b/engines/zvision/scripting/controls/titler_control.cpp index d6b1d34bae..542e0a0b67 100644 --- a/engines/zvision/scripting/controls/titler_control.cpp +++ b/engines/zvision/scripting/controls/titler_control.cpp @@ -73,8 +73,10 @@ TitlerControl::TitlerControl(ZVision *engine, uint32 key, Common::SeekableReadSt } TitlerControl::~TitlerControl() { - if (_surface) + if (_surface) { + _surface->free(); delete _surface; + } } void TitlerControl::setString(int strLine) { |