aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
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;