Fix memory leaks in ZynAddSubFX
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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<float *> &smp);
|
||||
void setpreset(unsigned char npreset);
|
||||
void changepar(int npar, unsigned char value);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user