aboutsummaryrefslogtreecommitdiff
path: root/sound/mididrv.cpp
diff options
context:
space:
mode:
authorNicolas Noble2002-05-18 11:48:48 +0000
committerNicolas Noble2002-05-18 11:48:48 +0000
commit53f993be44ac34c3f17677cb432a366dec962824 (patch)
treee343920ed42b24100d3dc47bdb86a78a7362e8d6 /sound/mididrv.cpp
parent17319703a970439f68c0d0426b5022e8bb629fff (diff)
downloadscummvm-rg350-53f993be44ac34c3f17677cb432a366dec962824.tar.gz
scummvm-rg350-53f993be44ac34c3f17677cb432a366dec962824.tar.bz2
scummvm-rg350-53f993be44ac34c3f17677cb432a366dec962824.zip
Fixing ALSA driver to not segfault when launching simon. It still isn't
supported but it's better signaled now. BTW I think there is a bug somewhere since the close() method were called without beeing open()'d. Oh well... svn-id: r4347
Diffstat (limited to 'sound/mididrv.cpp')
-rw-r--r--sound/mididrv.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index e4155f0d25..f2aa0a43f8 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -1581,8 +1581,9 @@ int MidiDriver_ALSA::open(int mode) {
}
void MidiDriver_ALSA::close() {
- _mode = 0;
- snd_seq_close(seq_handle);
+ _mode = 0;
+ if (seq_handle)
+ snd_seq_close(seq_handle);
}