Bug 935846, nsJSEnvironment should get a shutdown notification also in child processes, r=romaxa

--HG--
extra : rebase_source : 782bc88e47ecb750b4220fe01e3f74ebcfa05493
This commit is contained in:
Olli Pettay 2014-10-22 18:57:32 +03:00
parent d791610ba4
commit 63a24cde86

View File

@ -282,7 +282,8 @@ nsJSEnvironmentObserver::Observe(nsISupports* aSubject, const char* aTopic,
nsJSContext::NonIncrementalGC,
nsJSContext::ShrinkingGC);
}
} else if (!nsCRT::strcmp(aTopic, "quit-application")) {
} else if (!nsCRT::strcmp(aTopic, "quit-application") ||
!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
sShuttingDown = true;
KillTimers();
}
@ -2848,6 +2849,7 @@ nsJSContext::EnsureStatics()
nsIObserver* observer = new nsJSEnvironmentObserver();
obs->AddObserver(observer, "memory-pressure", false);
obs->AddObserver(observer, "quit-application", false);
obs->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
// Bug 907848 - We need to explicitly get the nsIDOMScriptObjectFactory
// service in order to force its constructor to run, which registers a