[Scummvm-cvs-logs] SF.net SVN: scummvm:[50870] scummvm/trunk/backends/midi/alsa.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed Jul 14 06:33:36 CEST 2010


Revision: 50870
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50870&view=rev
Author:   eriktorbjorn
Date:     2010-07-14 04:33:35 +0000 (Wed, 14 Jul 2010)

Log Message:
-----------
If the ALSA driver hasn't been opened, closing it should do nothing. This keeps
ScummVM from crashing if, for instance, someone accidentally closes the driver
twice.

Modified Paths:
--------------
    scummvm/trunk/backends/midi/alsa.cpp

Modified: scummvm/trunk/backends/midi/alsa.cpp
===================================================================
--- scummvm/trunk/backends/midi/alsa.cpp	2010-07-14 03:57:36 UTC (rev 50869)
+++ scummvm/trunk/backends/midi/alsa.cpp	2010-07-14 04:33:35 UTC (rev 50870)
@@ -150,10 +150,13 @@
 }
 
 void MidiDriver_ALSA::close() {
-	_isOpen = false;
-	MidiDriver_MPU401::close();
-	if (seq_handle)
-		snd_seq_close(seq_handle);
+	if (_isOpen) {
+		_isOpen = false;
+		MidiDriver_MPU401::close();
+		if (seq_handle)
+			snd_seq_close(seq_handle);
+	} else
+		warning("MidiDriver_ALSA: Closing the driver before opening it");
 }
 
 void MidiDriver_ALSA::send(uint32 b) {


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