From 4ca5f185a3b53b88258621115711760d59c49a01 Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Tue, 25 Apr 2000 07:26:02 +0000 Subject: [PATCH] be less aggresive in shutdown cleanup to avoid shutdown crashes. See bug 37058 for an example stack. --- js/src/xpconnect/src/nsXPConnect.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/js/src/xpconnect/src/nsXPConnect.cpp b/js/src/xpconnect/src/nsXPConnect.cpp index 07330a2233a5..3121a67a8297 100644 --- a/js/src/xpconnect/src/nsXPConnect.cpp +++ b/js/src/xpconnect/src/nsXPConnect.cpp @@ -176,13 +176,6 @@ nsXPConnect::nsXPConnect() nsXPConnect::~nsXPConnect() { - // Calling this Cleanup *before* doing the ShutDown stuff below is - // fairly aggressive. There is some danger that we could get into trouble - // With reentrancy into the xpconnect runtime as we are in the process of - // kiling it. But, this seems to be working. This call could be moved lower - // in this dtor (or commented out!) if problems develop. - xpcPerThreadData::CleanupAllThreads(); - NS_IF_RELEASE(mArbitraryScriptable); NS_IF_RELEASE(mInterfaceInfoManager); NS_IF_RELEASE(mContextStack); @@ -190,6 +183,17 @@ nsXPConnect::~nsXPConnect() nsXPCWrappedNativeScope::SystemIsBeingShutDown(); + // Unfortunately calling CleanupAllThreads before the stuff above + // (esp. SystemIsBeingShutDown) causes too many bad things to happen + // as the Release calls propagate. See the comment in this function in + // revision 1.35 of this file. + // + // I filed a bug on xpcom regarding the bad things that happen + // if people try to create components during shutdown. + // http://bugzilla.mozilla.org/show_bug.cgi?id=37058 + // + xpcPerThreadData::CleanupAllThreads(); + if(mThrower) delete mThrower; if(mRuntime)