For unsetup de-allocate the memory
that has been allocated locally in the code model during INIT
This commit is contained in:
parent
7d12b4897c
commit
2867678f99
|
|
@ -532,6 +532,22 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt)
|
||||||
tfree(here->state);
|
tfree(here->state);
|
||||||
tfree(here->conv);
|
tfree(here->conv);
|
||||||
tfree(here->intgr);
|
tfree(here->intgr);
|
||||||
|
|
||||||
|
/* de-allocate the memory that has been allocated locally in the code model during INIT */
|
||||||
|
if (here->callback) {
|
||||||
|
Mif_Private_t cm_data;
|
||||||
|
/* Prepare the structure to be passed to the code model */
|
||||||
|
cm_data.num_conn = here->num_conn;
|
||||||
|
cm_data.conn = here->conn;
|
||||||
|
cm_data.num_param = here->num_param;
|
||||||
|
cm_data.param = here->param;
|
||||||
|
cm_data.num_inst_var = here->num_inst_var;
|
||||||
|
cm_data.inst_var = here->inst_var;
|
||||||
|
cm_data.callback = &(here->callback);
|
||||||
|
|
||||||
|
here->callback(&cm_data, MIF_CB_DESTROY);
|
||||||
|
}
|
||||||
|
|
||||||
here->initialized = MIF_FALSE;
|
here->initialized = MIF_FALSE;
|
||||||
} /* end for all instances */
|
} /* end for all instances */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue