add function trnoise_state_free and use it
instead of its individual components
This commit is contained in:
parent
7bf81eb122
commit
b4c6a7d324
|
|
@ -241,3 +241,12 @@ trrandom_state_init(int rndtype, double TS, double TD, double PARAM1, double PAR
|
|||
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
trnoise_state_free(struct trnoise_state *this)
|
||||
{
|
||||
if (!this)
|
||||
return;
|
||||
tfree(this->oneof);
|
||||
tfree(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ VSRCdelete(GENinstance *gen_inst)
|
|||
VSRCinstance *inst = (VSRCinstance *) gen_inst;
|
||||
|
||||
FREE(inst->VSRCcoeffs);
|
||||
if (inst->VSRCtrnoise_state) {
|
||||
FREE(inst->VSRCtrnoise_state->oneof);
|
||||
FREE(inst->VSRCtrnoise_state);
|
||||
}
|
||||
trnoise_state_free(inst->VSRCtrnoise_state);
|
||||
FREE(inst->VSRCtrrandom_state);
|
||||
|
||||
return OK;
|
||||
|
|
|
|||
Loading…
Reference in New Issue