diff options
author | msofer <msofer@noemail.net> | 2001-12-07 13:55:58 (GMT) |
---|---|---|
committer | msofer <msofer@noemail.net> | 2001-12-07 13:55:58 (GMT) |
commit | 2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d (patch) | |
tree | be9d02ee7c40c6fd4919fc83c406315d3807c43d /generic/tclVar.c | |
parent | 0234a989743aa7d0ccaa772437be0b4e72e00192 (diff) | |
download | tcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.zip tcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.tar.gz tcl-2a04bc5fdf738c2b608b3b423ca5b5f3911ca74d.tar.bz2 |
restored consistency in refCount accounting by array traces [Bug #4484339]
FossilOrigin-Name: 23f9cbbc0021bbbab98aa4a6d1cdad7ed3c106d5
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r-- | generic/tclVar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c index 401e36b..134ca16 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.43 2001/12/05 20:43:58 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.44 2001/12/07 13:55:59 msofer Exp $ */ #include "tclInt.h" @@ -4514,6 +4514,9 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags, resultTypePtr) } varPtr->flags |= VAR_TRACE_ACTIVE; varPtr->refCount++; + if (arrayPtr != NULL) { + arrayPtr->refCount++; + } /* * If the variable name hasn't been parsed into array name and @@ -4556,7 +4559,6 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags, resultTypePtr) iPtr->activeTracePtr = &active; Tcl_Preserve((ClientData) iPtr); if (arrayPtr != NULL && !(arrayPtr->flags & VAR_TRACE_ACTIVE)) { - arrayPtr->refCount++; active.varPtr = arrayPtr; for (tracePtr = arrayPtr->tracePtr; tracePtr != NULL; tracePtr = active.nextTracePtr) { |