diff options
author | hobbs <hobbs> | 2007-09-10 23:05:45 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-09-10 23:05:45 (GMT) |
commit | 0d3e2f0116da21f2c52ef225148e17555d4be6ff (patch) | |
tree | abef9c4169cc4c9e0c5f789af2bc9e95fc0147b2 /generic | |
parent | 6726323860d0fd2b135fac517b16af7e6f03dfc7 (diff) | |
download | tcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.zip tcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.tar.gz tcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.tar.bz2 |
* generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being
unlinked. [Bug 1740631] (maros)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclLink.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c index 0f33c03..59eb70f 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLink.c,v 1.22 2007/05/07 19:45:33 dgp Exp $ + * RCS: @(#) $Id: tclLink.c,v 1.23 2007/09/10 23:05:46 hobbs Exp $ */ #include "tclInt.h" @@ -215,7 +215,14 @@ Tcl_UpdateLinkedVar( linkPtr->flags |= LINK_BEING_UPDATED; Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr), TCL_GLOBAL_ONLY); - linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag; + /* + * Callback may have unlinked the variable. [Bug 1740631] + */ + linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY, + LinkTraceProc, (ClientData) NULL); + if (linkPtr != NULL) { + linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag; + } } /* |