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
This commit is contained in:
David Rajchenbach-Teller 2016-01-28 11:17:49 +01:00
Родитель 01e2bd1f48
Коммит 17e41f6c46
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -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]);
}
},