summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2011-06-17 20:03:24 (GMT)
committerdgp <dgp@noemail.net>2011-06-17 20:03:24 (GMT)
commit576da61148dc6673eef8d671f26b5f0a3c3401a8 (patch)
tree54e16c2a06dee07b42bb129bdf9ccc51317ac76d
parent5cf8bbee658b3ee15ef6988217cb11771818f5f9 (diff)
downloadtcl-576da61148dc6673eef8d671f26b5f0a3c3401a8.zip
tcl-576da61148dc6673eef8d671f26b5f0a3c3401a8.tar.gz
tcl-576da61148dc6673eef8d671f26b5f0a3c3401a8.tar.bz2
3062331 Caveat added to comments.
FossilOrigin-Name: 143461c50b6bb58fb128dc5de83321518776a7be
-rw-r--r--generic/tclTrace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 49c57bc..28e6934 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -2874,6 +2874,16 @@ Tcl_UntraceVar2(
* The code below makes it possible to delete traces while traces are
* active: it makes sure that the deleted trace won't be processed by
* TclCallVarTraces.
+ *
+ * Caveat (Bug 3062331): When an unset trace handler on a variable
+ * tries to delete a different unset trace handler on the same variable,
+ * the results may be surprising. When variable unset traces fire, the
+ * traced variable is already gone. So the TclLookupVar() call above
+ * will not find that variable, and not finding it will never reach here
+ * to perform the deletion. This means callers of Tcl_UntraceVar*()
+ * attempting to delete unset traces from within the handler of another
+ * unset trace have to account for the possibility that their call to
+ * Tcl_UntraceVar*() is a no-op.
*/
for (activePtr = iPtr->activeVarTracePtr; activePtr != NULL;