diff --git a/vpi/sys_lxt.c b/vpi/sys_lxt.c index f2c9cf950..cb50d8a69 100644 --- a/vpi/sys_lxt.c +++ b/vpi/sys_lxt.c @@ -297,6 +297,8 @@ static PLI_INT32 dumpvars_cb(p_cb_data cause) static PLI_INT32 finish_cb(p_cb_data cause) { + struct vcd_info *cur, *next; + if (finish_status != 0) return 0; finish_status = 1; @@ -306,6 +308,17 @@ static PLI_INT32 finish_cb(p_cb_data cause) lt_set_time64(dump_file, dumpvars_time); } + for (cur = vcd_list ; cur ; cur = next) { + next = cur->next; + free(cur); + } + vcd_list = 0; + + vcd_names_delete(&lxt_tab); + nexus_ident_delete(); + free(dump_path); + dump_path = 0; + return 0; } diff --git a/vpi/sys_lxt2.c b/vpi/sys_lxt2.c index 65074b2c3..e31f8995a 100644 --- a/vpi/sys_lxt2.c +++ b/vpi/sys_lxt2.c @@ -299,6 +299,8 @@ static PLI_INT32 dumpvars_cb(p_cb_data cause) static PLI_INT32 finish_cb(p_cb_data cause) { + struct vcd_info *cur, *next; + if (finish_status != 0) return 0; finish_status = 1; @@ -308,6 +310,17 @@ static PLI_INT32 finish_cb(p_cb_data cause) lxt2_wr_set_time64(dump_file, dumpvars_time); } + for (cur = vcd_list ; cur ; cur = next) { + next = cur->next; + free(cur); + } + vcd_list = 0; + + vcd_names_delete(&lxt_tab); + nexus_ident_delete(); + free(dump_path); + dump_path = 0; + return 0; } diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index e7637ea90..bcb678826 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -264,6 +264,7 @@ static PLI_INT32 finish_cb(p_cb_data cause) free((char *)cur->ident); free(cur); } + vcd_list = 0; vcd_names_delete(&vcd_tab); vcd_names_delete(&vcd_var); nexus_ident_delete();