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
This commit is contained in:
Alyssa Milburn 2011-02-07 13:36:59 +00:00
parent 6f9ac84f77
commit dda8266ec8

View File

@ -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;