diff options
author | dkf <dkf@noemail.net> | 2010-02-11 09:00:52 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2010-02-11 09:00:52 (GMT) |
commit | 3210171350d43bee750fab4c947ee8fd03ece865 (patch) | |
tree | 33d9dba11defdf7e29846db93d37472a98b86cff /generic/tclOO.c | |
parent | d374e5f5a88c28be8937d7a6d1c76697ec1daf26 (diff) | |
download | tcl-3210171350d43bee750fab4c947ee8fd03ece865.zip tcl-3210171350d43bee750fab4c947ee8fd03ece865.tar.gz tcl-3210171350d43bee750fab4c947ee8fd03ece865.tar.bz2 |
[Bug 2949397]: Prevent destructors from running on the two core class objects
when the whole interpreter is being destroyed.
FossilOrigin-Name: ed48aba1da92fb37a3f277bf56003797823b3fd1
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) { |