Bug 1340425 - Add back the magic GC in DoShutdown() to avoid intermittent leaks. r=smaug

MozReview-Commit-ID: CNkjPk9FLKj

--HG--
extra : rebase_source : 157fddbf60bfffe2ec7a5dece66c6121624a612e
This commit is contained in:
Andrew McCreight 2017-08-23 10:27:12 -07:00
parent a309c38dac
commit 03450c1c40

View File

@ -1101,6 +1101,14 @@ nsXREDirProvider::DoShutdown()
static const char16_t kShutdownPersist[] = u"shutdown-persist";
obsSvc->NotifyObservers(nullptr, "profile-change-net-teardown", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-change-teardown", kShutdownPersist);
#ifdef DEBUG
// Not having this causes large intermittent leaks. See bug 1340425.
if (JSContext* cx = dom::danger::GetJSContext()) {
JS_GC(cx);
}
#endif
obsSvc->NotifyObservers(nullptr, "profile-before-change", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-before-change-qm", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-before-change-telemetry", kShutdownPersist);