[Scummvm-cvs-logs] SF.net SVN: scummvm:[47384] scummvm/trunk/engines/sci/sound
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Jan 19 18:34:25 CET 2010
Revision: 47384
http://scummvm.svn.sourceforge.net/scummvm/?rev=47384&view=rev
Author: thebluegr
Date: 2010-01-19 17:34:24 +0000 (Tue, 19 Jan 2010)
Log Message:
-----------
Delete the inner music driver when MidiPlayer_AdLib() is destroyed, not in close(), as MidiPlayer_AdLib() is closed and reopened inside SciMusic::resetDriver(). Fixes savegame loading and resetting the game
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/music.cpp
scummvm/trunk/engines/sci/sound/softseq/adlib.cpp
Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp 2010-01-19 16:57:36 UTC (rev 47383)
+++ scummvm/trunk/engines/sci/sound/music.cpp 2010-01-19 17:34:24 UTC (rev 47384)
@@ -146,6 +146,8 @@
void SciMusic::resetDriver() {
Common::StackLock lock(_mutex);
+ // TODO/FIXME: is there any better way to reset the driver?
+
_pMidiDrv->close();
_pMidiDrv->open();
_pMidiDrv->setTimerCallback(this, &miditimerCallback);
Modified: scummvm/trunk/engines/sci/sound/softseq/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/softseq/adlib.cpp 2010-01-19 16:57:36 UTC (rev 47383)
+++ scummvm/trunk/engines/sci/sound/softseq/adlib.cpp 2010-01-19 17:34:24 UTC (rev 47384)
@@ -161,7 +161,10 @@
class MidiPlayer_AdLib : public MidiPlayer {
public:
MidiPlayer_AdLib() { _driver = new MidiDriver_AdLib(g_system->getMixer()); }
- ~MidiPlayer_AdLib() {}
+ ~MidiPlayer_AdLib() {
+ delete _driver;
+ _driver = 0;
+ }
int open(ResourceManager *resMan);
void close();
@@ -817,8 +820,6 @@
void MidiPlayer_AdLib::close() {
if (_driver) {
_driver->close();
- delete _driver;
- _driver = 0;
}
}
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