From 64aa67bd929d210bd1d764bd73312496dee8002d Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Sun, 1 Jun 2008 05:09:35 +0000 Subject: * generic/tclOOMethod.c: Fix a bug where the refcount of a method was reset if the method was redefined while there was an active invocation. [Bug #1981001] --- ChangeLog | 5 +++++ generic/tclOOMethod.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fa25e0..45510b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,11 @@ Thanks to George Peter Staplin for the report. + * generic/tclOOMethod.c: Fix a bug where the refcount of a method + was reset if the method was redefined while + there was an active invocation. + [Bug #1981001] + 2008-06-01 Donal K. Fellows * generic/tclOO.decls, unix/Makefile.in (genstubs): Make generation of diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 9d53d6a..678334e 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.3 2008/05/31 23:35:27 das Exp $ + * RCS: @(#) $Id: tclOOMethod.c,v 1.4 2008/06/01 05:09:36 kennykb Exp $ */ #ifdef HAVE_CONFIG_H @@ -135,6 +135,7 @@ Tcl_NewInstanceMethod( if (isNew) { mPtr = (Method *) ckalloc(sizeof(Method)); mPtr->namePtr = nameObj; + mPtr->refCount = 1; Tcl_IncrRefCount(nameObj); Tcl_SetHashValue(hPtr, mPtr); } else { @@ -147,7 +148,6 @@ Tcl_NewInstanceMethod( populate: mPtr->typePtr = typePtr; mPtr->clientData = clientData; - mPtr->refCount = 1; mPtr->flags = 0; mPtr->declaringObjectPtr = oPtr; mPtr->declaringClassPtr = NULL; -- cgit v0.12