From 0c863ddec8f39d1afec9b67d4e899e4489d6f46e Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 10 May 2019 20:30:41 +0000 Subject: Start of TIP 543 implementation. --- doc/TraceVar.3 | 2 +- generic/tcl.h | 4 ++++ generic/tclTrace.c | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 index 19cb467..e481985 100644 --- a/doc/TraceVar.3 +++ b/doc/TraceVar.3 @@ -95,7 +95,7 @@ Invoke \fIproc\fR whenever an attempt is made to modify the variable. Invoke \fIproc\fR whenever the variable is unset. A variable may be unset either explicitly by an \fBunset\fR command, or implicitly when a procedure returns (its local variables are -automatically unset) or when the interpreter is deleted (all +automatically unset) or when the interpreter or namespace is deleted (all variables are automatically unset). .TP \fBTCL_TRACE_ARRAY\fR diff --git a/generic/tcl.h b/generic/tcl.h index e34a609..d76b334 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -1031,7 +1031,11 @@ typedef struct Tcl_DString { #define TCL_TRACE_WRITES 0x20 #define TCL_TRACE_UNSETS 0x40 #define TCL_TRACE_DESTROYED 0x80 + +#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 #define TCL_INTERP_DESTROYED 0x100 +#endif + #define TCL_LEAVE_ERR_MSG 0x200 #define TCL_TRACE_ARRAY 0x800 #ifndef TCL_REMOVE_OBSOLETE_TRACES diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 20fa7e7..8662d70 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -79,8 +79,7 @@ typedef struct { * TCL_TRACE_EXEC_DIRECT - This execution trace is triggered directly * by the command being traced, not because of * an internal trace. - * The flags 'TCL_TRACE_DESTROYED' and 'TCL_INTERP_DESTROYED' may also be used - * in command execution traces. + * The flag 'TCL_TRACE_DESTROYED' may also be used in command execution traces. */ #define TCL_TRACE_ENTER_DURING_EXEC 4 @@ -2565,6 +2564,9 @@ TclObjCallVarTraces( leaveErrMsg); } +#undef TCL_INTERP_DESTROYED +#define TCL_INTERP_DESTROYED 0x100 + int TclCallVarTraces( Interp *iPtr, /* Interpreter containing variable. */ -- cgit v0.12