[Scummvm-cvs-logs] SF.net SVN: scummvm:[43714] scummvm/trunk/engines/scumm/imuse

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Tue Aug 25 00:41:56 CEST 2009


Revision: 43714
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43714&view=rev
Author:   dhewg
Date:     2009-08-24 22:41:56 +0000 (Mon, 24 Aug 2009)

Log Message:
-----------
Fixed iMuse regression: IMuseInternal::terminate() was never called, because the base class does not have that virtual function anymore. Code moved to the destructor.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse/imuse.cpp
    scummvm/trunk/engines/scumm/imuse/imuse_internal.h

Modified: scummvm/trunk/engines/scumm/imuse/imuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse.cpp	2009-08-24 22:37:09 UTC (rev 43713)
+++ scummvm/trunk/engines/scumm/imuse/imuse.cpp	2009-08-24 22:41:56 UTC (rev 43714)
@@ -73,6 +73,36 @@
 	memset(_volchan_table,0,sizeof(_volchan_table));
 }
 
+IMuseInternal::~IMuseInternal() {
+	// Do just enough stuff inside the mutex to
+	// make sure any MIDI timing threads won't
+	// interrupt us, and then do the rest outside
+	// the mutex.
+	{
+		Common::StackLock lock(_mutex, "IMuseInternal::~IMuseInternal()");
+		_initialized = false;
+		stopAllSounds_internal();
+	}
+
+	if (_midi_adlib) {
+		_midi_adlib->close();
+		delete _midi_adlib;
+		_midi_adlib = 0;
+	}
+
+	if (_midi_native) {
+		if (_native_mt32) {
+			// Reset the MT-32
+			_midi_native->sysEx((const byte *) "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9);
+			_system->delayMillis(250);
+		}
+
+		_midi_native->close();
+		delete _midi_native;
+		_midi_native = 0;
+	}
+}
+
 byte *IMuseInternal::findStartOfSound(int sound) {
 	byte *ptr = NULL;
 	int32 size, pos;
@@ -518,36 +548,6 @@
 	return best_time;
 }
 
-void IMuseInternal::terminate() {
-	// Do just enough stuff inside the mutex to
-	// make sure any MIDI timing threads won't
-	// interrupt us, and then do the rest outside
-	// the mutex.
-	{
-		Common::StackLock lock(_mutex, "IMuseInternal::terminate()");
-		_initialized = false;
-		stopAllSounds_internal();
-	}
-
-	if (_midi_adlib) {
-		_midi_adlib->close();
-		delete _midi_adlib;
-		_midi_adlib = 0;
-	}
-
-	if (_midi_native) {
-		if (_native_mt32) {
-			// Reset the MT-32
-			_midi_native->sysEx((const byte *) "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9);
-			_system->delayMillis(250);
-		}
-
-		_midi_native->close();
-		delete _midi_native;
-		_midi_native = 0;
-	}
-}
-
 ////////////////////////////////////////
 //
 // Internal versions of the IMuse and

Modified: scummvm/trunk/engines/scumm/imuse/imuse_internal.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse_internal.h	2009-08-24 22:37:09 UTC (rev 43713)
+++ scummvm/trunk/engines/scumm/imuse/imuse_internal.h	2009-08-24 22:41:56 UTC (rev 43714)
@@ -445,6 +445,8 @@
 
 protected:
 	IMuseInternal();
+	virtual ~IMuseInternal();
+
 	int initialize(OSystem *syst, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver);
 
 	static void midiTimerCallback(void *data);
@@ -526,7 +528,6 @@
 	void stopAllSounds();
 	int getSoundStatus(int sound) const;
 	int getMusicTimer() const;
-	void terminate();
 
 public:
 	// Factory function


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