From 17e41f6c466ac4e6022da66c7ac93f00e90a7180 Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Thu, 28 Jan 2016 11:17:49 +0100 Subject: [PATCH] Bug 1221761 - Probe.prototype.release() now swallows NS_ERROR_NOT_AVAILABLE. r=felipe During shutdown, we may find ourselves attempting to release and shutdown a probe while the PerformanceStats service is already shutdown. In this case, since the probe is already shutdown, we can simply ignore the error. --HG-- extra : transplant_source : %BBT%84%26.%AD%7B%23%1C%BC%3F%85%F9%18%A3%D8%84%EC%02%BE --- toolkit/components/perfmonitoring/PerformanceStats.jsm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/toolkit/components/perfmonitoring/PerformanceStats.jsm b/toolkit/components/perfmonitoring/PerformanceStats.jsm index 6b1f32b12299..bef641e8fd07 100644 --- a/toolkit/components/perfmonitoring/PerformanceStats.jsm +++ b/toolkit/components/perfmonitoring/PerformanceStats.jsm @@ -95,7 +95,15 @@ Probe.prototype = { release: function() { this._counter--; if (this._counter == 0) { - this._impl.isActive = false; + try { + this._impl.isActive = false; + } catch (ex) { + if (ex && typeof ex == "object" && ex.result == Components.results.NS_ERROR_NOT_AVAILABLE) { + // The service has already been shutdown. Ignore further shutdown requests. + return; + } + throw ex; + } Process.broadcast("release", [this._name]); } },