Bug 1428795 - Uninitalise Marionette on xpcom-will-shutdown. r=automatedtester

Marionette was previously uninitialised when xpcom-shutdown fired.
This may be too late to reset preferences and other state related
to the browser.

This patch moves Marionette to run uninitialisation code on
xpcom-will-shutdown.

MozReview-Commit-ID: 3ytX2k2rrOp

--HG--
extra : rebase_source : 6b9918515b48b2d1166cc985c5d5aeeb82937db0
This commit is contained in:
Andreas Tolfsen 2018-02-26 20:36:29 +00:00
parent 00a171e75d
commit 1d2ab66b43

View File

@ -462,7 +462,7 @@ class MarionetteMainProcess {
if (this.gfxWindow === null || subject === this.gfxWindow) {
Services.obs.removeObserver(this, topic);
Services.obs.addObserver(this, "xpcom-shutdown");
Services.obs.addObserver(this, "xpcom-will-shutdown");
this.finalUIStartup = true;
this.init();
}
@ -491,15 +491,15 @@ class MarionetteMainProcess {
if (this.gfxWindow) {
Services.obs.addObserver(this, "domwindowclosed");
} else {
Services.obs.addObserver(this, "xpcom-shutdown");
Services.obs.addObserver(this, "xpcom-will-shutdown");
this.finalUIStartup = true;
this.init();
}
break;
case "xpcom-shutdown":
Services.obs.removeObserver(this, "xpcom-shutdown");
case "xpcom-will-shutdown":
Services.obs.removeObserver(this, "xpcom-will-shutdown");
this.uninit();
break;
}