Tcl Source Code

Artifact [3f21699a59]
Login

Artifact 3f21699a595e1ac4ebe5a24d125d994c2db98c46:

Attachment "1355342.patch" to ticket [1355342fff] added by dgp 2005-11-14 23:45:20.
Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.181
diff -u -r1.181 tclBasic.c
--- generic/tclBasic.c	13 Nov 2005 01:38:15 -0000	1.181
+++ generic/tclBasic.c	14 Nov 2005 16:37:01 -0000
@@ -2612,6 +2612,7 @@
     ActiveCommandTrace active;
     char *result;
     Tcl_Obj *oldNamePtr = NULL;
+    Tcl_InterpState state = NULL;
 
     if (cmdPtr->flags & CMD_TRACE_ACTIVE) {
 	/*
@@ -2662,6 +2663,9 @@
 	    oldName = TclGetString(oldNamePtr);
 	}
 	tracePtr->refCount++;
+	if (state == NULL) {
+	    state = Tcl_SaveInterpState((Tcl_Interp *)iPtr, TCL_OK);
+	}
 	(*tracePtr->traceProc)(tracePtr->clientData,
 		(Tcl_Interp *) iPtr, oldName, newName, flags);
 	cmdPtr->flags &= ~tracePtr->flags;
@@ -2670,6 +2674,10 @@
 	}
     }
 
+    if (state) {
+	Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state);
+    }
+
     /*
      * If a new object was created to hold the full oldName, free it now.
      */