From bbba395582262a7e113592f6756418e39ed94e3c Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 8 Mar 2024 22:29:53 +0100 Subject: [PATCH] reordering execution of simulation callback after deletion of execute(win_path,$id)_simulate_id --- src/xschem.tcl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index 5d410ba5..5d3fe22b 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -291,17 +291,20 @@ proc execute_fileevent {id} { if { ![info exists err] } { set err {} } set execute(error,last) $err set execute(status,last) $execute(status,$id) - if {[info exists execute(callback,$id)] && $execute(callback,$id) ne {}} { - # puts $execute(callback,$id) - # puts $execute(win_path,$id) - eval uplevel #0 [list $execute(callback,$id)] - } + if { [info exists tctx::$execute(win_path,$id)_simulate_id] } { if { [set tctx::$execute(win_path,$id)_simulate_id] eq $id } { unset tctx::$execute(win_path,$id)_simulate_id } } + + if {[info exists execute(callback,$id)] && $execute(callback,$id) ne {}} { + # puts $execute(callback,$id) + # puts $execute(win_path,$id) + eval uplevel #0 [list $execute(callback,$id)] + } catch {unset execute(callback,$id)} + if { ![info exists exit_status] } { set exit_status 0 } unset execute(pipe,$id) unset execute(data,$id)