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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jan 2 14:36:13 CET 2010


Revision: 46881
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46881&view=rev
Author:   thebluegr
Date:     2010-01-02 13:36:12 +0000 (Sat, 02 Jan 2010)

Log Message:
-----------
SCI/new music code: Fix for a music related crash in SCI0 games (the sound object can get deleted while polling it)

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

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 13:04:36 UTC (rev 46880)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 13:36:12 UTC (rev 46881)
@@ -768,6 +768,13 @@
 	}
 	_music->_mutex.unlock();	// unlock to perform mixer-related calls
 
+	// In SCI0, make absolutely sure that the sound object hasn't
+	// been deleted (can happen e.g. at the ending of QFG1)
+	if (_soundVersion <= SCI_VERSION_0_LATE) {
+		if (!_segMan->getObject(musicSlot->soundObj))
+			return;
+	}
+
 	// Update digital sound effect slots here
 	Audio::Mixer *mixer = g_system->getMixer();
 


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