summaryrefslogtreecommitdiffstats
path: root/generic/tclOODefineCmds.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2009-01-27 11:11:44 (GMT)
committerdkf <dkf@noemail.net>2009-01-27 11:11:44 (GMT)
commitc4cee0ea8e2c61f3ff6032593c809e607f9a8193 (patch)
tree134e578f0c907dd96a6f92f6c5f3ce1bef0ca0cb /generic/tclOODefineCmds.c
parentd8fe7a951b8f25ac81b03da09f1ec7b2693c54a9 (diff)
downloadtcl-c4cee0ea8e2c61f3ff6032593c809e607f9a8193.zip
tcl-c4cee0ea8e2c61f3ff6032593c809e607f9a8193.tar.gz
tcl-c4cee0ea8e2c61f3ff6032593c809e607f9a8193.tar.bz2
Fix [Bug 2531577]
FossilOrigin-Name: ff97a151d338337a3573a236fac7a7111c2ea84b
Diffstat (limited to 'generic/tclOODefineCmds.c')
-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);
}
}