summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-01-27 11:11:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-01-27 11:11:44 (GMT)
commit960bd1422f5ba24fa513f9738934538ab3140c73 (patch)
tree134e578f0c907dd96a6f92f6c5f3ce1bef0ca0cb /generic
parent038ad9c8c8c8a7c63a58858d7693942420d5babd (diff)
downloadtcl-960bd1422f5ba24fa513f9738934538ab3140c73.zip
tcl-960bd1422f5ba24fa513f9738934538ab3140c73.tar.gz
tcl-960bd1422f5ba24fa513f9738934538ab3140c73.tar.bz2
Fix [Bug 2531577]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclOODefineCmds.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c
index 5b1f354..ac65ee4 100644
--- a/generic/tclOODefineCmds.c
+++ b/generic/tclOODefineCmds.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclOODefineCmds.c,v 1.8 2008/12/02 19:40:41 dgp Exp $
+ * RCS: @(#) $Id: tclOODefineCmds.c,v 1.9 2009/01/27 11:11:47 dkf Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1933,6 +1933,16 @@ Tcl_ClassSetConstructor(
if (method != (Tcl_Method) clsPtr->constructorPtr) {
TclOODelMethodRef(clsPtr->constructorPtr);
clsPtr->constructorPtr = (Method *) method;
+
+ /*
+ * Remember to invalidate the cached constructor chain for this class.
+ * [Bug 2531577]
+ */
+
+ if (clsPtr->constructorChainPtr) {
+ TclOODeleteChain(clsPtr->constructorChainPtr);
+ clsPtr->constructorChainPtr = NULL;
+ }
BumpGlobalEpoch(interp, clsPtr);
}
}
@@ -1948,6 +1958,10 @@ Tcl_ClassSetDestructor(
if (method != (Tcl_Method) clsPtr->destructorPtr) {
TclOODelMethodRef(clsPtr->destructorPtr);
clsPtr->destructorPtr = (Method *) method;
+ if (clsPtr->destructorChainPtr) {
+ TclOODeleteChain(clsPtr->destructorChainPtr);
+ clsPtr->destructorChainPtr = NULL;
+ }
BumpGlobalEpoch(interp, clsPtr);
}
}