summaryrefslogtreecommitdiff
path: root/muse2/synti
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-10-03 15:25:12 +0000
committerFlorian Jung <flo@windfisch.org>2011-10-03 15:25:12 +0000
commit421cb6dbce48a6c1044dd37e8f710b83db5d11a9 (patch)
tree59a751bf904e6addff34b673f3025f5be8ec5c59 /muse2/synti
parent890ee8999eaca679fa1874adf3f572f365138e29 (diff)
parentf3313cc78e637ec9bc11efce5eb943434da93416 (diff)
merged with trunk, removed more memory leaks
Diffstat (limited to 'muse2/synti')
-rw-r--r--muse2/synti/deicsonze/deicsonzegui.h8
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp11
2 files changed, 15 insertions, 4 deletions
diff --git a/muse2/synti/deicsonze/deicsonzegui.h b/muse2/synti/deicsonze/deicsonzegui.h
index f82e072b..7dec344f 100644
--- a/muse2/synti/deicsonze/deicsonzegui.h
+++ b/muse2/synti/deicsonze/deicsonzegui.h
@@ -526,10 +526,10 @@ class QFramePitchEnvelope:private QFrame {
void env2Points(int pl1, int pl2, int pl3, int pr1, int pr2, int pr3);
void updateEnv(void) {update();};
protected:
- void paintEvent(QPaintEvent* e);
- void mouseMoveEvent(QMouseEvent* e);
- void mousePressEvent(QMouseEvent * e);
- void mouseReleaseEvent(QMouseEvent * e);
+ virtual void paintEvent(QPaintEvent* e);
+ virtual void mouseMoveEvent(QMouseEvent* e);
+ virtual void mousePressEvent(QMouseEvent * e);
+ virtual void mouseReleaseEvent(QMouseEvent * e);
};
class QFrameEnvelope:private QFrame {
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index a03c5da8..cc5c496a 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -115,6 +115,17 @@ FluidSynth::FluidSynth(int sr, pthread_mutex_t *_Globalsfloader_mutex) : Mess(2)
FluidSynth::~FluidSynth()
{
+
+ for (std::list<FluidSoundFont>::iterator it =stack.begin(); it !=stack.end(); it++)
+ {
+ if(it->intid == FS_UNSPECIFIED_FONT || it->intid == FS_UNSPECIFIED_ID)
+ continue;
+ //Try to unload soundfont
+ int err = fluid_synth_sfunload(fluidsynth, it->intid, 0);
+ if(err == -1)
+ std::cerr << DEBUG_ARGS << "Error unloading soundfont!" << fluid_synth_error(fluidsynth) << std::endl;
+ }
+
int err = delete_fluid_synth (fluidsynth);
if(gui)
delete gui;