Prevent memory leak while "PREDICTOR" is selected
This commit is contained in:
parent
301f50335d
commit
97e0c0f37e
|
|
@ -16,6 +16,7 @@ Author: 1985 Thomas L. Quarles
|
|||
void
|
||||
NIdestroy(CKTcircuit *ckt)
|
||||
{
|
||||
int i;
|
||||
if (ckt->CKTmatrix)
|
||||
SMPdestroy(ckt->CKTmatrix);
|
||||
ckt->CKTmatrix = NULL;
|
||||
|
|
@ -33,4 +34,10 @@ NIdestroy(CKTcircuit *ckt)
|
|||
SENdestroy(ckt->CKTsenInfo);
|
||||
}
|
||||
#endif
|
||||
#ifdef PREDICTOR
|
||||
if(ckt->CKTpred) FREE(ckt->CKTpred);
|
||||
for( i=0;i<8;i++) {
|
||||
if(ckt->CKTsols[i]) FREE(ckt->CKTsols[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,13 @@ CKTdestroy(CKTcircuit *ckt)
|
|||
FREE(ckt->CKTirhsOld);
|
||||
FREE(ckt->CKTirhsSpare);
|
||||
|
||||
#ifdef PREDICTOR
|
||||
if(ckt->CKTpred) FREE(ckt->CKTpred);
|
||||
for( i=0;i<8;i++) {
|
||||
if(ckt->CKTsols[i]) FREE(ckt->CKTsols[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
FREE(ckt->CKTstat->STATdevNum);
|
||||
FREE(ckt->CKTstat);
|
||||
FREE(ckt->CKThead);
|
||||
|
|
|
|||
Loading…
Reference in New Issue