devices/asrc, remove memory leak
This commit is contained in:
parent
b92b25950e
commit
27053b877f
|
|
@ -30,5 +30,9 @@ ASRCdestroy(GENmodel **inModel)
|
|||
mod = next_mod;
|
||||
}
|
||||
|
||||
FREE(asrc_vals);
|
||||
FREE(asrc_derivs);
|
||||
asrc_nvals = 0;
|
||||
|
||||
*inModel = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue