зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 490592 (Possible to GC way too much during shutdown due to XUL and XBL prototypes). r/sr=bz.
This commit is contained in:
Родитель
d4158c6c45
Коммит
b64b14221a
|
@ -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;
|
||||
|
|
|
@ -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!");
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -1674,8 +1674,6 @@ mozJSComponentLoader::Observe(nsISupports *subject, const char *topic,
|
|||
mFastLoadTimer->Cancel();
|
||||
}
|
||||
|
||||
JS_GC(mContext);
|
||||
|
||||
CloseFastLoad();
|
||||
}
|
||||
else if (!strcmp(topic, "xpcom-shutdown-loaders")) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче