зеркало из https://github.com/mozilla/gecko-dev.git
Bug 791910 - Deal with dead managers in our list. r=cjones
--HG-- extra : rebase_source : 3a3bda33a7cecd7336b84ad4939aa55de2e5d0dd
This commit is contained in:
Родитель
af1edb60ea
Коммит
74f0b6aa6b
|
@ -1948,8 +1948,15 @@ WifiWorker.prototype = {
|
|||
|
||||
_domManagers: [],
|
||||
_fireEvent: function(message, data) {
|
||||
this._domManagers.forEach(function(obj) {
|
||||
obj.manager.sendAsyncMessage("WifiManager:" + message, data);
|
||||
// TODO (bug 791911): Managers don't correctly tell us when they're getting
|
||||
// destroyed, so prune dead managers here.
|
||||
this._domManagers = this._domManagers.filter(function(obj) {
|
||||
try {
|
||||
obj.manager.sendAsyncMessage("WifiManager:" + message, data);
|
||||
return true;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче