devices/asrc, remove memory leak

This commit is contained in:
h_vogt 2016-07-24 18:02:17 +02:00 committed by rlar
parent b92b25950e
commit 27053b877f
2 changed files with 9 additions and 1 deletions

View File

@ -30,5 +30,9 @@ ASRCdestroy(GENmodel **inModel)
mod = next_mod;
}
FREE(asrc_vals);
FREE(asrc_derivs);
asrc_nvals = 0;
*inModel = NULL;
}

View File

@ -127,11 +127,15 @@ ASRCunsetup(GENmodel *inModel, CKTcircuit *ckt)
ASRCinstance *here;
for (; model; model = model->ASRCnextModel)
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance)
for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) {
if (here->ASRCbranch) {
CKTdltNNum(ckt, here->ASRCbranch);
here->ASRCbranch = 0;
}
FREE(here->ASRCposptr);
FREE(here->ASRCvars);
FREE(here->ASRCacValues);
}
return OK;
}