mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
b865be6ac9
commit
1ec8d2bfcb
@ -265,6 +265,7 @@ nsXBLDocGlobalObject::SetContext(nsIScriptContext *aScriptContext)
|
|||||||
nsresult rv;
|
nsresult rv;
|
||||||
rv = aScriptContext->InitContext(nsnull);
|
rv = aScriptContext->InitContext(nsnull);
|
||||||
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Script Language's InitContext failed");
|
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Script Language's InitContext failed");
|
||||||
|
aScriptContext->SetGCOnDestruction(PR_FALSE);
|
||||||
aScriptContext->DidInitializeContext();
|
aScriptContext->DidInitializeContext();
|
||||||
// and we set up our global manually
|
// and we set up our global manually
|
||||||
mScriptContext = aScriptContext;
|
mScriptContext = aScriptContext;
|
||||||
|
@ -693,6 +693,7 @@ nsXULPDGlobalObject::SetScriptContext(PRUint32 lang_id, nsIScriptContext *aScrip
|
|||||||
void *script_glob = nsnull;
|
void *script_glob = nsnull;
|
||||||
|
|
||||||
if (aScriptContext) {
|
if (aScriptContext) {
|
||||||
|
aScriptContext->SetGCOnDestruction(PR_FALSE);
|
||||||
aScriptContext->DidInitializeContext();
|
aScriptContext->DidInitializeContext();
|
||||||
script_glob = aScriptContext->GetNativeGlobal();
|
script_glob = aScriptContext->GetNativeGlobal();
|
||||||
NS_ASSERTION(script_glob, "GetNativeGlobal returned NULL!");
|
NS_ASSERTION(script_glob, "GetNativeGlobal returned NULL!");
|
||||||
|
@ -278,21 +278,6 @@ nsDOMScriptObjectFactory::Observe(nsISupports *aSubject,
|
|||||||
cache->Flush();
|
cache->Flush();
|
||||||
#endif
|
#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();
|
nsGlobalWindow::ShutDown();
|
||||||
nsDOMClassInfo::ShutDown();
|
nsDOMClassInfo::ShutDown();
|
||||||
|
|
||||||
|
@ -1674,8 +1674,6 @@ mozJSComponentLoader::Observe(nsISupports *subject, const char *topic,
|
|||||||
mFastLoadTimer->Cancel();
|
mFastLoadTimer->Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_GC(mContext);
|
|
||||||
|
|
||||||
CloseFastLoad();
|
CloseFastLoad();
|
||||||
}
|
}
|
||||||
else if (!strcmp(topic, "xpcom-shutdown-loaders")) {
|
else if (!strcmp(topic, "xpcom-shutdown-loaders")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user