Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.82.2.22
diff -u -r1.82.2.22 tclCmdMZ.c
--- generic/tclCmdMZ.c	29 Oct 2005 17:45:23 -0000	1.82.2.22
+++ generic/tclCmdMZ.c	1 Nov 2005 19:49:20 -0000
@@ -4223,19 +4223,21 @@
 	    active.reverseScan = 0;
 	    active.nextTracePtr = tracePtr->nextPtr;
         }
-	tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
-	if (tcmdPtr->flags != 0) {
-            tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT;
-            tcmdPtr->curCode  = code;
-	    tcmdPtr->refCount++;
-	    traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp, 
-	          curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
-	    tcmdPtr->refCount--;
-	    if (tcmdPtr->refCount < 0) {
-		Tcl_Panic("TclCheckExecutionTraces: negative TraceCommandInfo refCount");
-	    }
-	    if (tcmdPtr->refCount == 0) {
-	        ckfree((char*)tcmdPtr);
+	if (tracePtr->traceProc == TraceCommandProc) {
+	    tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
+	    if (tcmdPtr->flags != 0) {
+        	tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT;
+        	tcmdPtr->curCode  = code;
+		tcmdPtr->refCount++;
+		traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp, 
+			curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
+		tcmdPtr->refCount--;
+		if (tcmdPtr->refCount < 0) {
+		    Tcl_Panic("TclCheckExecutionTraces: negative TraceCommandInfo refCount");
+		}
+		if (tcmdPtr->refCount == 0) {
+		    ckfree((char*)tcmdPtr);
+		}
 	    }
 	}
 	if (active.nextTracePtr) {
