aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTravis Howell2009-01-27 03:13:13 +0000
committerTravis Howell2009-01-27 03:13:13 +0000
commit82a741419728a7c908ee31709051e9a0de0daa10 (patch)
tree2932469abbd091c9913a2983b32ffff81eb17fa3 /sound
parentbce799366fe3784966db23f9201e02c6c3c95e80 (diff)
downloadscummvm-rg350-82a741419728a7c908ee31709051e9a0de0daa10.tar.gz
scummvm-rg350-82a741419728a7c908ee31709051e9a0de0daa10.tar.bz2
scummvm-rg350-82a741419728a7c908ee31709051e9a0de0daa10.zip
Fix regression, the original stream shouldn't be deleted, unless disposeAfterUse is set.
svn-id: r36092
Diffstat (limited to 'sound')
-rw-r--r--sound/wave.cpp2
1 files changed, 2 insertions, 0 deletions
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;