diff options
author | dgp <dgp@users.sourceforge.net> | 2019-05-15 17:20:54 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-05-15 17:20:54 (GMT) |
commit | 53669ac6b8743ed34a13bcb8d68521966b4d479a (patch) | |
tree | b300f60a911b010c5d549d779fa061458b993154 /generic/tkMessage.c | |
parent | 1673645f691d6a028123a612d5476541b8305d91 (diff) | |
download | tk-53669ac6b8743ed34a13bcb8d68521966b4d479a.zip tk-53669ac6b8743ed34a13bcb8d68521966b4d479a.tar.gz tk-53669ac6b8743ed34a13bcb8d68521966b4d479a.tar.bz2 |
Tests and fix for [message ... -textvariable].
Diffstat (limited to 'generic/tkMessage.c')
-rw-r--r-- | generic/tkMessage.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 2b71998..1508beb 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -844,7 +844,27 @@ MessageTextVarProc( */ if (flags & TCL_TRACE_UNSETS) { - if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { + if (!Tcl_InterpDeleted(interp) && msgPtr->textVarName) { + ClientData probe = NULL; + + do { + probe = Tcl_VarTraceInfo(interp, + msgPtr->textVarName, + TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + MessageTextVarProc, probe); + if (probe == (ClientData)msgPtr) { + break; + } + } while (probe); + if (probe) { + /* + * We were able to fetch the unset trace for our + * textVarName, which means it is not unset and not + * the cause of this unset trace. Instead some outdated + * former variable must be, and we should ignore it. + */ + return NULL; + } Tcl_SetVar2(interp, msgPtr->textVarName, NULL, msgPtr->string, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, msgPtr->textVarName, NULL, |