summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-06-01 08:11:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-06-01 08:11:06 (GMT)
commitfe88072b187128153a10f1860ef4312d08254b9f (patch)
tree0dd3ea38d0f6cb60cee6eae9bc1b4e59abfa940b /generic
parent64aa67bd929d210bd1d764bd73312496dee8002d (diff)
downloadtcl-fe88072b187128153a10f1860ef4312d08254b9f.zip
tcl-fe88072b187128153a10f1860ef4312d08254b9f.tar.gz
tcl-fe88072b187128153a10f1860ef4312d08254b9f.tar.bz2
Complete fix of [Bug 1981001]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclOOMethod.c6
1 files changed, 4 insertions, 2 deletions
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;