diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-07 13:55:59 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-07 13:55:59 (GMT) |
commit | e69719ee4125cc09779401e3dda6c4b67651d382 (patch) | |
tree | be9d02ee7c40c6fd4919fc83c406315d3807c43d /generic/tclVar.c | |
parent | 6425a01b7a2896172c65f9883f0b56792a6fd263 (diff) | |
download | tcl-e69719ee4125cc09779401e3dda6c4b67651d382.zip tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.gz tcl-e69719ee4125cc09779401e3dda6c4b67651d382.tar.bz2 |
restored consistency in refCount accounting by array traces [Bug #4484339]
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) { |