From fe88072b187128153a10f1860ef4312d08254b9f Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 1 Jun 2008 08:11:06 +0000 Subject: Complete fix of [Bug 1981001] --- ChangeLog | 6 ++++++ generic/tclOOMethod.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45510b9..bd674eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-01 Donal K. Fellows + + * generic/tclOOMethod.c (Tcl_NewMethod): Complete the fix of [Bug + 1981001], previous fix was incomplete though helpful in telling me + where to look. + 2008-06-01 Joe Mistachkin * win/Makefile.in: Add tclOO genstubs to Windows makefiles and remove diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 678334e..053336e 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclOOMethod.c,v 1.4 2008/06/01 05:09:36 kennykb Exp $ + * RCS: @(#) $Id: tclOOMethod.c,v 1.5 2008/06/01 08:11:07 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -124,6 +124,7 @@ Tcl_NewInstanceMethod( if (nameObj == NULL) { mPtr = (Method *) ckalloc(sizeof(Method)); mPtr->namePtr = NULL; + mPtr->refCount = 1; goto populate; } if (!oPtr->methodsPtr) { @@ -191,11 +192,13 @@ Tcl_NewMethod( if (nameObj == NULL) { mPtr = (Method *) ckalloc(sizeof(Method)); mPtr->namePtr = NULL; + mPtr->refCount = 1; goto populate; } hPtr = Tcl_CreateHashEntry(&clsPtr->classMethods, (char *)nameObj,&isNew); if (isNew) { mPtr = (Method *) ckalloc(sizeof(Method)); + mPtr->refCount = 1; mPtr->namePtr = nameObj; Tcl_IncrRefCount(nameObj); Tcl_SetHashValue(hPtr, mPtr); @@ -210,7 +213,6 @@ Tcl_NewMethod( clsPtr->thisPtr->fPtr->epoch++; mPtr->typePtr = typePtr; mPtr->clientData = clientData; - mPtr->refCount = 1; mPtr->flags = 0; mPtr->declaringObjectPtr = NULL; mPtr->declaringClassPtr = clsPtr; -- cgit v0.12