[Scummvm-cvs-logs] SF.net SVN: scummvm:[55802] scummvm/trunk/video/smk_decoder.cpp

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Mon Feb 7 14:37:00 CET 2011


Revision: 55802
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55802&view=rev
Author:   fuzzie
Date:     2011-02-07 13:36:59 +0000 (Mon, 07 Feb 2011)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/video/smk_decoder.cpp

Modified: scummvm/trunk/video/smk_decoder.cpp
===================================================================
--- scummvm/trunk/video/smk_decoder.cpp	2011-02-07 12:24:09 UTC (rev 55801)
+++ scummvm/trunk/video/smk_decoder.cpp	2011-02-07 13:36:59 UTC (rev 55802)
@@ -494,10 +494,15 @@
 	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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list