summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r--generic/tclTrace.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index fa29160..fd7566d 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -1481,7 +1481,11 @@ TclCheckExecutionTraces(
}
iPtr->activeCmdTracePtr = active.nextPtr;
if (state) {
- (void) Tcl_RestoreInterpState(interp, state);
+ if (traceCode == TCL_OK) {
+ traceCode = Tcl_RestoreInterpState(interp, state);
+ } else {
+ Tcl_DiscardInterpState(state);
+ }
}
return(traceCode);
@@ -1628,7 +1632,7 @@ TclCheckInterpTraces(
iPtr->activeInterpTracePtr = active.nextPtr;
if (state) {
if (traceCode == TCL_OK) {
- (void) Tcl_RestoreInterpState(interp, state);
+ traceCode = Tcl_RestoreInterpState(interp, state);
} else {
Tcl_DiscardInterpState(state);
}
@@ -2722,7 +2726,7 @@ TclCallVarTraces(
iPtr->flags &= ~(ERR_ALREADY_LOGGED);
Tcl_DiscardInterpState(state);
} else {
- (void) Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state);
+ code = Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state);
}
DisposeTraceResult(disposeFlags,result);
} else if (state) {