From cf4ce277baa4e867af7b8d02edc496951d842f02 Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Mon, 9 Jun 2014 12:07:00 -0400 Subject: [PATCH] Bug 1017706 - Make sure that healthreporter.jsm always initiates shutdown, even if it never receives quit-application. r=gps --- services/healthreport/healthreporter.jsm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/healthreport/healthreporter.jsm b/services/healthreport/healthreporter.jsm index f33bf4f3479..e7ebf93bc3d 100644 --- a/services/healthreport/healthreporter.jsm +++ b/services/healthreport/healthreporter.jsm @@ -402,7 +402,15 @@ AbstractHealthReporter.prototype = Object.freeze({ // The database needs to be shut down by the end of shutdown // phase profileBeforeChange. Metrics.Storage.shutdown.addBlocker("FHR: Flushing storage shutdown", - this._promiseShutdown, + () => { + // Workaround bug 1017706 + // Apparently, in some cases, quit-application is not triggered + // (or is triggered after profile-before-change), so we need to + // make sure that `_initiateShutdown()` is triggered at least + // once. + this._initiateShutdown(); + return this._promiseShutdown; + }, () => ({ shutdownInitiated: this._shutdownInitiated, initialized: this._initialized, @@ -412,7 +420,7 @@ AbstractHealthReporter.prototype = Object.freeze({ storageInProgress: this._storageInProgress, hasProviderManager: !!this._providerManager, hasStorage: !!this._storage, - shutdownComplete: this.shutdownComplete + shutdownComplete: this._shutdownComplete })); try {