From 199425562e4a6e81d66adc41dfc2a5b78d2f0b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Johan=20Tr=C3=B8an=20S=C3=B8ma=CC=8Aen?= Date: Thu, 24 Jan 2013 17:49:24 +0100 Subject: [PATCH] WINTERMUTE: Fix a leak in sound-file loading. --- engines/wintermute/base/sound/base_sound_buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp index e8f4fcec53b..d2b265a254f 100644 --- a/engines/wintermute/base/sound/base_sound_buffer.cpp +++ b/engines/wintermute/base/sound/base_sound_buffer.cpp @@ -111,7 +111,7 @@ bool BaseSoundBuffer::loadFromFile(const Common::String &filename, bool forceRel if (Audio::loadWAVFromStream(*_file, waveSize, waveRate, waveFlags, &waveType)) { if (waveType == 1) { // We need to wrap the file in a substream to make sure the size is right. - _file = new Common::SeekableSubReadStream(_file, _file->pos(), waveSize + _file->pos()); + _file = new Common::SeekableSubReadStream(_file, _file->pos(), waveSize + _file->pos(), DisposeAfterUse::YES); _stream = Audio::makeRawStream(_file, waveRate, waveFlags, DisposeAfterUse::YES); } else { error("BSoundBuffer::LoadFromFile - WAVE not supported yet for %s with type %d", filename.c_str(), waveType);