Bug 818739, don't run CC during shutdown, r=mccr8

This commit is contained in:
Olli Pettay 2012-12-14 20:41:11 +02:00
parent 0f660cd9d4
commit 971bd03b79

View File

@ -2955,14 +2955,18 @@ nsCycleCollector::SuspectedCount()
void
nsCycleCollector::Shutdown()
{
// Here we want to run a final collection and then permanently
// disable the collector because the program is shutting down.
nsCOMPtr<nsCycleCollectorLogger> listener;
if (mParams.mLogGraphs) {
listener = new nsCycleCollectorLogger();
#ifndef DEBUG
#ifndef DEBUG_CC
if (PR_GetEnv("XPCOM_CC_RUN_DURING_SHUTDOWN"))
#endif
#endif
{
nsCOMPtr<nsCycleCollectorLogger> listener;
if (mParams.mLogGraphs) {
listener = new nsCycleCollectorLogger();
}
Collect(false, nullptr, SHUTDOWN_COLLECTIONS(mParams), listener);
}
Collect(false, nullptr, SHUTDOWN_COLLECTIONS(mParams), listener);
#ifdef DEBUG_CC
GCGraphBuilder builder(mGraph, mJSRuntime, nullptr, false);