diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2010-02-11 09:00:53 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2010-02-11 09:00:53 (GMT) |
| commit | 91b46744d725e40a26c3d8a1f60380ba4fe11475 (patch) | |
| tree | 33d9dba11defdf7e29846db93d37472a98b86cff /generic/tclOO.c | |
| parent | d87b2af8de491c1fb3237446397ae7c66e3e5b0a (diff) | |
| download | tcl-91b46744d725e40a26c3d8a1f60380ba4fe11475.zip tcl-91b46744d725e40a26c3d8a1f60380ba4fe11475.tar.gz tcl-91b46744d725e40a26c3d8a1f60380ba4fe11475.tar.bz2 | |
[Bug 2949397]: Prevent destructors from running on the two core class objects
when the whole interpreter is being destroyed.
Diffstat (limited to 'generic/tclOO.c')
| -rw-r--r-- | generic/tclOO.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c index f52ff35..507f8b5 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.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: tclOO.c,v 1.30 2010/02/05 20:53:12 nijtmans Exp $ + * RCS: @(#) $Id: tclOO.c,v 1.31 2010/02/11 09:00:55 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -660,13 +660,20 @@ ObjectRenamedTrace( * command. Because of that case, we must take care here to mark the * command as being deleted so that if we return here we don't run into * reentrancy problems. + * + * We also do not run destructors on the core class objects when the + * interpreter is being deleted; their incestuous nature causes problems + * in that case when the destructor is partially deleted before the uses + * of it have gone. [Bug 2949397] */ AddRef(oPtr); oPtr->command = NULL; oPtr->flags |= OBJECT_DELETED; - if (!(oPtr->flags & DESTRUCTOR_CALLED)) { + if (!(oPtr->flags & DESTRUCTOR_CALLED) && (!Tcl_InterpDeleted(interp) + || (oPtr != oPtr->fPtr->objectCls->thisPtr + && oPtr != oPtr->fPtr->classCls->thisPtr))) { contextPtr = TclOOGetCallContext(oPtr, NULL, DESTRUCTOR, NULL); oPtr->flags |= DESTRUCTOR_CALLED; if (contextPtr != NULL) { |
