[Scummvm-cvs-logs] SF.net SVN: scummvm:[47675] scummvm/trunk/engines/sci/sound/soundcmd.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Jan 29 18:45:31 CET 2010
Revision: 47675
http://scummvm.svn.sourceforge.net/scummvm/?rev=47675&view=rev
Author: thebluegr
Date: 2010-01-29 17:45:30 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
Don't modify the objects of sound slots that are already stopped, as the associated objects could have been disposed. Fixes odd crashes in SQ3
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp 2010-01-29 16:26:40 UTC (rev 47674)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp 2010-01-29 17:45:30 UTC (rev 47675)
@@ -511,11 +511,15 @@
return;
}
- PUT_SEL32V(_segMan, obj, handle, 0);
- if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(_segMan, obj, state, kSoundStopped);
- else
- PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+ // Don't modify the objects of sound slots that are already stopped,
+ // as the associated objects could have been disposed
+ if (musicSlot->status != kSoundStopped) {
+ PUT_SEL32V(_segMan, obj, handle, 0);
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ PUT_SEL32V(_segMan, obj, state, kSoundStopped);
+ else
+ PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+ }
musicSlot->dataInc = 0;
musicSlot->signal = 0;
@@ -903,10 +907,14 @@
const MusicList::iterator end = _music->getPlayListEnd();
for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) {
- if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(_segMan, (*i)->soundObj, state, kSoundStopped);
- else
- PUT_SEL32V(_segMan, (*i)->soundObj, signal, SIGNAL_OFFSET);
+ // Don't modify the objects of sound slots that are already stopped,
+ // as the associated objects could have been disposed
+ if ((*i)->status != kSoundStopped) {
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ PUT_SEL32V(_segMan, (*i)->soundObj, state, kSoundStopped);
+ else
+ PUT_SEL32V(_segMan, (*i)->soundObj, signal, SIGNAL_OFFSET);
+ }
(*i)->dataInc = 0;
_music->soundStop(*i);
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