diff options
author | Alyssa Milburn | 2011-02-07 13:36:59 +0000 |
---|---|---|
committer | Alyssa Milburn | 2011-02-07 13:36:59 +0000 |
commit | dda8266ec810d2e289e4d0f661078f60d69d9903 (patch) | |
tree | 588e6b5c9ec1ef303af16d89c3d56e153d9560c6 | |
parent | 6f9ac84f77f140c8008ffec0e57fcf2ddd17a10e (diff) | |
download | scummvm-rg350-dda8266ec810d2e289e4d0f661078f60d69d9903.tar.gz scummvm-rg350-dda8266ec810d2e289e4d0f661078f60d69d9903.tar.bz2 scummvm-rg350-dda8266ec810d2e289e4d0f661078f60d69d9903.zip |
VIDEO: Fix a leak in the Smacker decoder.
If audio was not yet started when a video was closed, the audio
stream would be leaked.
svn-id: r55802
-rw-r--r-- | video/smk_decoder.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp index 454bc6dde5..366c434b1b 100644 --- a/video/smk_decoder.cpp +++ b/video/smk_decoder.cpp @@ -494,10 +494,15 @@ void SmackerDecoder::close() { if (!_fileStream) return; - if (_audioStarted && _audioStream) { - _mixer->stopHandle(_audioHandle); + if (_audioStream) { + if (_audioStarted) { + // The mixer will delete the stream. + _mixer->stopHandle(_audioHandle); + _audioStarted = false; + } else { + delete _audioStream; + } _audioStream = 0; - _audioStarted = false; } delete _fileStream; |