mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 791910 - Deal with dead managers in our list. r=cjones
--HG-- extra : rebase_source : 3a3bda33a7cecd7336b84ad4939aa55de2e5d0dd
This commit is contained in:
parent
af1edb60ea
commit
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;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user