Fix for bug 490592 (Possible to GC way too much during shutdown due to XUL and XBL prototypes). r/sr=bz.

--HG--
extra : rebase_source : 8a05db1e4aab7dde3b38c7613488314dde05f163
This commit is contained in:
Peter Van der Beken 2009-05-07 11:19:41 -07:00
parent b865be6ac9
commit 1ec8d2bfcb
4 changed files with 2 additions and 17 deletions

View File

@ -265,6 +265,7 @@ nsXBLDocGlobalObject::SetContext(nsIScriptContext *aScriptContext)
nsresult rv;
rv = aScriptContext->InitContext(nsnull);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Script Language's InitContext failed");
aScriptContext->SetGCOnDestruction(PR_FALSE);
aScriptContext->DidInitializeContext();
// and we set up our global manually
mScriptContext = aScriptContext;

View File

@ -693,6 +693,7 @@ nsXULPDGlobalObject::SetScriptContext(PRUint32 lang_id, nsIScriptContext *aScrip
void *script_glob = nsnull;
if (aScriptContext) {
aScriptContext->SetGCOnDestruction(PR_FALSE);
aScriptContext->DidInitializeContext();
script_glob = aScriptContext->GetNativeGlobal();
NS_ASSERTION(script_glob, "GetNativeGlobal returned NULL!");

View File

@ -278,21 +278,6 @@ nsDOMScriptObjectFactory::Observe(nsISupports *aSubject,
cache->Flush();
#endif
nsCOMPtr<nsIThreadJSContextStack> stack =
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
if (stack) {
JSContext *cx = nsnull;
stack->GetSafeJSContext(&cx);
if (cx) {
// Do one final GC to clean things up before shutdown.
::JS_GC(cx);
}
}
nsGlobalWindow::ShutDown();
nsDOMClassInfo::ShutDown();

View File

@ -1674,8 +1674,6 @@ mozJSComponentLoader::Observe(nsISupports *subject, const char *topic,
mFastLoadTimer->Cancel();
}
JS_GC(mContext);
CloseFastLoad();
}
else if (!strcmp(topic, "xpcom-shutdown-loaders")) {