diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp index 7bb7e7640..93ba504de 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp @@ -102,6 +102,16 @@ LocalZynAddSubFx::~LocalZynAddSubFx() void LocalZynAddSubFx::initConfig() { + //Delete existing objects before recreating them in config.init(). Neccesarry, because the constructor and setLmmsWorkingDir() invoke this function. + if( config.cfg.LinuxOSSWaveOutDev != NULL ) + { + delete[] config.cfg.LinuxOSSWaveOutDev; + delete[] config.cfg.LinuxOSSSeqInDev; + + for(int i = 0; i < config.winmidimax; ++i) + delete[] config.winmididevices[i].name; + delete[] config.winmididevices; + } config.init(); config.cfg.GzipCompression = 0; diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp index e03fcef71..6468f16b1 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp @@ -43,6 +43,14 @@ EQ::EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, in cleanup(); } +EQ::~EQ() +{ + for(int i = 0; i < MAX_EQ_BANDS; ++i) { + delete filter[i].l; + delete filter[i].r; + } +} + // Cleanup the effect void EQ::cleanup(void) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h index b2e9e89a9..6192861cd 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h @@ -30,7 +30,7 @@ class EQ:public Effect { public: EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize); - ~EQ() {} + ~EQ(); void out(const Stereo &smp); void setpreset(unsigned char npreset); void changepar(int npar, unsigned char value); diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp index c43f1fa3f..5391b9a5f 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp @@ -694,7 +694,7 @@ void ADnote::KillNote() KillVoice(nvoice); if(NoteVoicePar[nvoice].VoiceOut) - delete NoteVoicePar[nvoice].VoiceOut; + delete[] NoteVoicePar[nvoice].VoiceOut; NoteVoicePar[nvoice].VoiceOut = NULL; }