diff options
author | Florian Jung <flo@windfisch.org> | 2011-10-03 15:25:12 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-10-03 15:25:12 +0000 |
commit | 421cb6dbce48a6c1044dd37e8f710b83db5d11a9 (patch) | |
tree | 59a751bf904e6addff34b673f3025f5be8ec5c59 /muse2/muse/driver | |
parent | 890ee8999eaca679fa1874adf3f572f365138e29 (diff) | |
parent | f3313cc78e637ec9bc11efce5eb943434da93416 (diff) |
merged with trunk, removed more memory leaks
Diffstat (limited to 'muse2/muse/driver')
-rw-r--r-- | muse2/muse/driver/alsamidi.cpp | 25 | ||||
-rw-r--r-- | muse2/muse/driver/alsamidi.h | 3 |
2 files changed, 25 insertions, 3 deletions
diff --git a/muse2/muse/driver/alsamidi.cpp b/muse2/muse/driver/alsamidi.cpp index 6395bf2d..8ad9c510 100644 --- a/muse2/muse/driver/alsamidi.cpp +++ b/muse2/muse/driver/alsamidi.cpp @@ -3,7 +3,7 @@ // Linux Music Editor // $Id: alsamidi.cpp,v 1.8.2.7 2009/11/19 04:20:33 terminator356 Exp $ // (C) Copyright 2000-2001 Werner Schweer (ws@seh.de) -// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -42,7 +42,7 @@ static int alsaSeqFdi = -1; static int alsaSeqFdo = -1; -snd_seq_t* alsaSeq; +snd_seq_t* alsaSeq = 0; static snd_seq_addr_t musePort; //--------------------------------------------------------- @@ -795,6 +795,27 @@ bool initMidiAlsa() return false; } +namespace MusEApp { + +//--------------------------------------------------------- +// exitMidiAlsa +//--------------------------------------------------------- + +void exitMidiAlsa() +{ + if(alsaSeq) + { + int error = snd_seq_close(alsaSeq); // FIXME Hm, this did not get rid of a buch of valgrind leaks. + if(error < 0) + { + fprintf(stderr, "Could not close ALSA sequencer: %s\n", snd_strerror(error)); + } + } +} + +} // namespace MusEApp + + struct AlsaPort { snd_seq_addr_t adr; char* name; diff --git a/muse2/muse/driver/alsamidi.h b/muse2/muse/driver/alsamidi.h index 13e07ca4..9badd7c4 100644 --- a/muse2/muse/driver/alsamidi.h +++ b/muse2/muse/driver/alsamidi.h @@ -3,7 +3,7 @@ // Linux Music Editor // $Id: alsamidi.h,v 1.2 2004/01/14 09:06:43 wschweer Exp $ // (C) Copyright 2001 Werner Schweer (ws@seh.de) -// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net) +// (C) Copyright 2011 Tim E. Real (terminator356 on sourceforge) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -77,6 +77,7 @@ class MidiAlsaDevice : public MidiDevice { }; extern bool initMidiAlsa(); +extern bool exitMidiAlsa(); extern int alsaSelectRfd(); extern int alsaSelectWfd(); extern void alsaProcessMidiInput(); |