summaryrefslogtreecommitdiff
path: root/muse2/muse/song.cpp
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/song.cpp
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/song.cpp')
-rw-r--r--muse2/muse/song.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp
index 6a43e457..a994b0e6 100644
--- a/muse2/muse/song.cpp
+++ b/muse2/muse/song.cpp
@@ -2341,6 +2341,8 @@ void Song::cleanupForQuit()
printf("deleting midi devices except synths\n");
for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd)
{
+ // Close the device. Handy to do all devices here, including synths.
+ (*imd)->close();
// Since Syntis are midi devices, there's no need to delete them below.
if((*imd)->isSynti())
continue;
@@ -2373,12 +2375,16 @@ void Song::cleanupForQuit()
continue;
delete (*imi);
}
- midiInstruments.clear(); // midi devices
+ midiInstruments.clear(); // midi instruments
// Nothing required for ladspa plugin list, and rack instances of them
// are handled by ~AudioTrack.
if(MusEGlobal::debugMsg)
+ printf("Muse: Deleting sound files\n");
+ SndFile::sndFiles.clearDelete();
+
+ if(MusEGlobal::debugMsg)
printf("...finished cleaning up.\n");
}