summaryrefslogtreecommitdiff
path: root/muse2/muse/driver
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-10-03 01:56:34 +0000
committerTim E. Real <termtech@rogers.com>2011-10-03 01:56:34 +0000
commitf3313cc78e637ec9bc11efce5eb943434da93416 (patch)
tree29ca2c60eb262e25831639d09c33b80ff0df511c /muse2/muse/driver
parent9200bb81f55b0d33e0a61af0112f1ca294375554 (diff)
Fixed HUGE massive memory leaks in all things using CItemList,
and SndFile, dssi, fluidsynth and other huge leaks. Large song with several dssi, vst, fluidsynths leaked 100's of MB, now only ~2MB.
Diffstat (limited to 'muse2/muse/driver')
-rw-r--r--muse2/muse/driver/alsamidi.cpp25
-rw-r--r--muse2/muse/driver/alsamidi.h3
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();