Browse Source

add function trnoise_state_free and use it

instead of its individual components
pre-master-46
Holger Vogt 8 years ago
parent
commit
b4c6a7d324
  1. 9
      src/frontend/trannoise/1-f-code.c
  2. 5
      src/spicelib/devices/vsrc/vsrcdel.c

9
src/frontend/trannoise/1-f-code.c

@ -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);
}

5
src/spicelib/devices/vsrc/vsrcdel.c

@ -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…
Cancel
Save