[Scummvm-cvs-logs] SF.net SVN: scummvm:[45670] scummvm/trunk/engines/sci/sfx/core.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Nov 4 16:51:52 CET 2009


Revision: 45670
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45670&view=rev
Author:   thebluegr
Date:     2009-11-04 15:51:50 +0000 (Wed, 04 Nov 2009)

Log Message:
-----------
Applied patch #2891230 - "SCI sfx: fix song iterators from not getting freed"

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sfx/core.cpp

Modified: scummvm/trunk/engines/sci/sfx/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/core.cpp	2009-11-04 15:41:40 UTC (rev 45669)
+++ scummvm/trunk/engines/sci/sfx/core.cpp	2009-11-04 15:51:50 UTC (rev 45670)
@@ -561,8 +561,15 @@
 
 	// WORKAROUND: sometimes, newsong can be NULL (e.g. in SQ4).
 	// Handle this here, so that we avoid a crash
-	if (!newsong)
+	if (!newsong) {	
+		// Iterators should get freed when there's only one song left playing
+		if(oldfirst && oldfirst->_status == SOUND_STATUS_STOPPED) {
+			debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx\n", oldfirst->_handle);
+			if (_player && oldfirst->_it)
+				_player->iterator_message(SongIterator::Message(oldfirst->_it->ID, SIMSG_STOP));
+		}
 		return;
+	}
 
 	for (newseeker = newsong; newseeker;
 	        newseeker = newseeker->_nextPlaying) {


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