1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-10 23:55:45 +01:00

Fix potential races.

This commit is contained in:
Kris Maglione
2014-02-23 12:20:22 -08:00
parent 9470e18566
commit c37656f731
3 changed files with 10 additions and 7 deletions

View File

@@ -351,9 +351,10 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
if (observers) {
let value = this.get(data, false);
this._observers[data] = observers.filter(function (callback) {
if (!callback.get())
callback = callback.get();
if (!callback)
return false;
util.trapErrors(callback.get(), null, value);
util.trapErrors(callback, null, value);
return true;
});
}