From e9903522196176c24a6adb973355631b7d3938e3 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 27 Jan 2006 00:10:18 +0000 Subject: Fix memory leak, if called directly. svn-id: r20199 --- sound/wave.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/wave.cpp b/sound/wave.cpp index bd3c2aed05..c3bb12b1cf 100644 --- a/sound/wave.cpp +++ b/sound/wave.cpp @@ -110,7 +110,7 @@ bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate, // Prepare the return values. rate = samplesPerSec; - flags = 0; + flags = Audio::Mixer::FLAG_AUTOFREE; if (bitsPerSample == 8) // 8 bit data is unsigned flags |= Audio::Mixer::FLAG_UNSIGNED; else if (bitsPerSample == 16) // 16 bit data is signed little endian @@ -169,7 +169,6 @@ AudioStream *makeWAVStream(Common::SeekableReadStream &stream) { byte *data = (byte *)malloc(size); assert(data); stream.read(data, size); - flags |= Audio::Mixer::FLAG_AUTOFREE; return makeLinearInputStream(rate, flags, data, size, 0, 0); } -- cgit v1.2.3