Index: generic/tclCmdMZ.c =================================================================== RCS file: /cvsroot/tcl/generic/tclCmdMZ.c,v retrieving revision 1.28 diff -c -r1.28 tclCmdMZ.c *** tclCmdMZ.c 2000/08/25 02:04:28 1.28 --- tclCmdMZ.c 2000/08/25 19:13:32 *************** *** 2668,2675 **** TraceVarProc, clientData); if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); } ! ckfree((char *) tvarPtr); break; } } --- 2668,2676 ---- TraceVarProc, clientData); if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); + tvarPtr->errMsg = NULL; } ! Tcl_EventuallyFree((ClientData) tvarPtr, TCL_DYNAMIC); break; } } *************** *** 2852,2859 **** TraceCommandProc, clientData); if (tcmdPtr->errMsg != NULL) { ckfree(tcmdPtr->errMsg); } ! ckfree((char *) tcmdPtr); break; } } --- 2853,2861 ---- TraceCommandProc, clientData); if (tcmdPtr->errMsg != NULL) { ckfree(tcmdPtr->errMsg); + tcmdPtr->errMsg = NULL; } ! Tcl_EventuallyFree((ClientData) tcmdPtr, TCL_DYNAMIC); break; } } *************** *** 3029,3036 **** TraceVarProc, clientData); if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); } ! ckfree((char *) tvarPtr); break; } } --- 3031,3039 ---- TraceVarProc, clientData); if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); + tvarPtr->errMsg = NULL; } ! Tcl_EventuallyFree((ClientData) tvarPtr, TCL_DYNAMIC); break; } } *************** *** 3321,3326 **** --- 3324,3330 ---- int code; Tcl_DString cmd; + Tcl_Preserve((ClientData) tcmdPtr); if (tcmdPtr->errMsg != NULL) { ckfree(tcmdPtr->errMsg); tcmdPtr->errMsg = NULL; *************** *** 3363,3371 **** if (flags & TCL_TRACE_DESTROYED) { if (tcmdPtr->errMsg != NULL) { ckfree(tcmdPtr->errMsg); } ! ckfree((char *) tcmdPtr); } return; } --- 3367,3377 ---- if (flags & TCL_TRACE_DESTROYED) { if (tcmdPtr->errMsg != NULL) { ckfree(tcmdPtr->errMsg); + tcmdPtr->errMsg = NULL; } ! Tcl_EventuallyFree((ClientData) tcmdPtr, TCL_DYNAMIC); } + Tcl_Release((ClientData) tcmdPtr); return; } *************** *** 3404,3409 **** --- 3410,3416 ---- int code; Tcl_DString cmd; + Tcl_Preserve((ClientData) tvarPtr); result = NULL; if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); *************** *** 3476,3484 **** result = NULL; if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); } ! ckfree((char *) tvarPtr); } return result; } --- 3483,3493 ---- result = NULL; if (tvarPtr->errMsg != NULL) { ckfree(tvarPtr->errMsg); + tvarPtr->errMsg = NULL; } ! Tcl_EventuallyFree((ClientData) tvarPtr, TCL_DYNAMIC); } + Tcl_Release((ClientData) tvarPtr); return result; }