aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDavid Turner2010-11-13 08:08:58 +0000
committerDavid Turner2010-11-13 08:08:58 +0000
commit6c78ca487652e95f855ec043cc11c2875f44b4b3 (patch)
tree006490adf93d21a693b5bc26ac683b0a92aacb69 /engines
parentdb51fb33863fa8676f78cdfe475f82559a648f83 (diff)
downloadscummvm-rg350-6c78ca487652e95f855ec043cc11c2875f44b4b3.tar.gz
scummvm-rg350-6c78ca487652e95f855ec043cc11c2875f44b4b3.tar.bz2
scummvm-rg350-6c78ca487652e95f855ec043cc11c2875f44b4b3.zip
HUGO: Close two minor memory leaks.
Destructor added to SoundHandler and added delete for _intro in engine destructor. svn-id: r54225
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/hugo.cpp1
-rw-r--r--engines/hugo/sound.cpp4
-rw-r--r--engines/hugo/sound.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index bf1daf1819..142fac0f88 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -160,6 +160,7 @@ HugoEngine::~HugoEngine() {
delete _inventory;
delete _mouse;
delete _screen;
+ delete _intro;
delete _scheduler;
delete _file;
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index b8a5a3297e..b4c42c4631 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -246,6 +246,10 @@ SoundHandler::SoundHandler(HugoEngine *vm) : _vm(vm) {
_midiPlayer = new MidiPlayer(driver);
}
+SoundHandler::~SoundHandler() {
+ delete _midiPlayer;
+}
+
void SoundHandler::setMusicVolume() {
/* Set the FM music volume from config.mvolume (0..100%) */
diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h
index ff38a7f70a..d377ddc834 100644
--- a/engines/hugo/sound.h
+++ b/engines/hugo/sound.h
@@ -42,6 +42,7 @@ class MidiPlayer;
class SoundHandler {
public:
SoundHandler(HugoEngine *vm);
+ ~SoundHandler();
void toggleMusic();
void toggleSound();