summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclOOMethod.c4
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 <dkf@users.sf.net>
* 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;