diff options
author | dgp <dgp@users.sourceforge.net> | 2011-04-27 18:32:14 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-04-27 18:32:14 (GMT) |
commit | 0d12754dbe6102188981d9d78ca772201250947b (patch) | |
tree | d9ac97eac3ae2c7f2ffe55c456dff83270d6e1e1 | |
parent | 3b9139924b1097de66255cd243de80d6eccb46ba (diff) | |
download | tcl-0d12754dbe6102188981d9d78ca772201250947b.zip tcl-0d12754dbe6102188981d9d78ca772201250947b.tar.gz tcl-0d12754dbe6102188981d9d78ca772201250947b.tar.bz2 |
FreeListInternalRep() cleanup.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | generic/tclListObj.c | 12 |
2 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,7 @@ 2011-04-27 Don Porter <dgp@users.sourceforge.net> + * generic/tclListObj.c: FreeListInternalRep() cleanup. + * generic/tclBinary.c: Backport fix for [Bug 2857044]. * generic/tclDictObj.c: All freeIntRepProcs set typePtr to NULL. * generic/tclEncoding.c: diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 036d624..3b9dce6 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1623,16 +1623,14 @@ static void FreeListInternalRep( Tcl_Obj *listPtr) /* List object with internal rep to free. */ { - register List *listRepPtr = ListRepPtr(listPtr); - register Tcl_Obj **elemPtrs = &listRepPtr->elements; - register Tcl_Obj *objPtr; - int numElems = listRepPtr->elemCount; - int i; + List *listRepPtr = ListRepPtr(listPtr); if (--listRepPtr->refCount <= 0) { + Tcl_Obj **elemPtrs = &listRepPtr->elements; + int i, numElems = listRepPtr->elemCount; + for (i = 0; i < numElems; i++) { - objPtr = elemPtrs[i]; - Tcl_DecrRefCount(objPtr); + Tcl_DecrRefCount(elemPtrs[i]); } ckfree((char *) listRepPtr); } |