diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclLink.c | 11 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2007-09-10 Jeff Hobbs <jeffh@ActiveState.com> + + * generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being + unlinked. [Bug 1740631] (maros) + 2007-09-10 Miguel Sofer <msofer@users.sf.net> * generic/tclCompile.c: fix tclInstructionTable entry for 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; + } } /* |