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:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user