[SCM] calf/master: * Organ: memory leak fixes, reduced memory usage * Monosynth: memory leak fixes, reduced memory usage * GUI: read-after-free bug fix
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:37:22 UTC 2013
The following commit has been merged in the master branch:
commit 273806c4c997a8693a3d14844ce21b86039d3d05
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Wed Jul 2 06:55:09 2008 +0000
* Organ: memory leak fixes, reduced memory usage
* Monosynth: memory leak fixes, reduced memory usage
* GUI: read-after-free bug fix
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@219 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/src/calf/organ.h b/src/calf/organ.h
index 1aa12b1..508f5e5 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -387,6 +387,7 @@ struct drawbar_organ: public synth::basic_synth {
percussion.setup(sr);
parameters->cutoff = 0;
update_params();
+ global_vibrato.reset();
}
void update_params();
void control_change(int controller, int value)
diff --git a/src/calf/osc.h b/src/calf/osc.h
index 7b79d2d..9bffa33 100644
--- a/src/calf/osc.h
+++ b/src/calf/osc.h
@@ -136,17 +136,7 @@ struct waveform_family: public map<uint32_t, float *>
{
memcpy(original, input, sizeof(original));
bl.compute_spectrum(input);
- bl.remove_dc();
make_from_spectrum(bl, foldover);
-
- uint32_t multiple = 1, base = 1 << (32 - SIZE_BITS);
- while(multiple < limit) {
- float *wf = new float[SIZE+1];
- bl.make_waveform(wf, (int)((1 << SIZE_BITS) / (1.5 * multiple)), foldover);
- wf[SIZE] = wf[0];
- (*this)[base * multiple] = wf;
- multiple = multiple << 1;
- }
}
void make_from_spectrum(bandlimiter<SIZE_BITS> &bl, bool foldover = false, uint32_t limit = SIZE / 2)
@@ -171,6 +161,12 @@ struct waveform_family: public map<uint32_t, float *>
// printf("Level = %08x\n", i->first);
return i->second;
}
+ ~waveform_family()
+ {
+ for (iterator i = begin(); i != end(); i++)
+ delete i->second;
+ clear();
+ }
};
template<int SIZE_BITS>
diff --git a/src/gui.cpp b/src/gui.cpp
index 01a8457..5c04dba 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -889,8 +889,9 @@ string plugin_gui_window::make_gui_preset_list(GtkActionGroup *grp, bool builtin
stringstream ss;
ss << (builtin ? "builtin_preset" : "user_preset") << i;
preset_xml += " <menuitem name=\""+pvec[i].name+"\" action=\""+ss.str()+"\"/>\n";
-
- GtkActionEntry ae = { ss.str().c_str(), NULL, pvec[i].name.c_str(), NULL, NULL, (GCallback)activate_preset };
+
+ string sv = ss.str();
+ GtkActionEntry ae = { sv.c_str(), NULL, pvec[i].name.c_str(), NULL, NULL, (GCallback)activate_preset };
gtk_action_group_add_actions_full(preset_actions, &ae, 1, (gpointer)new activate_preset_params(gui, i, builtin), action_destroy_notify);
}
preset_xml += preset_post_xml;
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list