mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
merge backout
This commit is contained in:
commit
226ffe4a61
@ -265,7 +265,6 @@ 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,7 +693,6 @@ 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,6 +278,21 @@ 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();
|
||||
|
||||
|
@ -582,7 +582,6 @@ js_DestroyContext(JSContext *cx, JSDestroyContextMode mode)
|
||||
JSContextCallback cxCallback;
|
||||
JSBool last;
|
||||
|
||||
rt = cx->runtime;
|
||||
#ifdef JS_THREADSAFE
|
||||
/*
|
||||
* For API compatibility we allow to destroy contexts without a thread in
|
||||
@ -592,9 +591,10 @@ js_DestroyContext(JSContext *cx, JSDestroyContextMode mode)
|
||||
JS_ASSERT(cx->thread && CURRENT_THREAD_IS_ME(cx->thread));
|
||||
if (!cx->thread)
|
||||
JS_SetContextThread(cx);
|
||||
#endif
|
||||
rt = cx->runtime;
|
||||
|
||||
JS_ASSERT_IF(rt->gcRunning, cx->outstandingRequests == 0);
|
||||
#endif
|
||||
|
||||
if (mode != JSDCM_NEW_FAILED) {
|
||||
cxCallback = rt->cxCallback;
|
||||
|
@ -1674,6 +1674,8 @@ mozJSComponentLoader::Observe(nsISupports *subject, const char *topic,
|
||||
mFastLoadTimer->Cancel();
|
||||
}
|
||||
|
||||
JS_GC(mContext);
|
||||
|
||||
CloseFastLoad();
|
||||
}
|
||||
else if (!strcmp(topic, "xpcom-shutdown-loaders")) {
|
||||
|
Loading…
Reference in New Issue
Block a user