From 0d12754dbe6102188981d9d78ca772201250947b Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 27 Apr 2011 18:32:14 +0000 Subject: FreeListInternalRep() cleanup. --- ChangeLog | 2 ++ generic/tclListObj.c | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73c9ca7..6cc8ded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-04-27 Don Porter + * 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); } -- cgit v0.12