From 82a741419728a7c908ee31709051e9a0de0daa10 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Tue, 27 Jan 2009 03:13:13 +0000 Subject: Fix regression, the original stream shouldn't be deleted, unless disposeAfterUse is set. svn-id: r36092 --- sound/wave.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/wave.cpp b/sound/wave.cpp index c829c41e0f..83cc23c35a 100644 --- a/sound/wave.cpp +++ b/sound/wave.cpp @@ -185,6 +185,8 @@ AudioStream *makeWAVStream(Common::SeekableReadStream *stream, bool disposeAfter data = (byte *)malloc(size); assert(data); stream->read(data, size); + if (disposeAfterUse) + delete stream; // Since we allocated our own buffer for the data, we must set the autofree flag. flags |= Audio::Mixer::FLAG_AUTOFREE; -- cgit v1.2.3