1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 11:24:10 +01:00

Fix some brokenness

This commit is contained in:
Kris Maglione
2008-10-05 07:40:26 +00:00
parent 7da0d970ff
commit 05aac8ced6
5 changed files with 46 additions and 23 deletions

View File

@@ -1560,15 +1560,15 @@ liberator.Events = function () //{{{
{
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
this._branch = prefService.getBranch(""); // better way to monitor all changes?
this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
this._branch.addObserver("", this, false);
this._branch = prefService.getBranch(""); // better way to monitor all changes?
this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
this._branch.addObserver("", this, false);
},
unregister: function ()
{
if (!this._branch) return;
this._branch.removeObserver("", this);
if (this._branch)
this._branch.removeObserver("", this);
},
observe: function (aSubject, aTopic, aData)
@@ -1603,7 +1603,10 @@ liberator.Events = function () //{{{
catch (e) {}
eventManager.prefObserver.register();
liberator.registerCallback("shutdown", 0, eventManager.destroy);
liberator.registerObserver("shutdown", function () {
eventManager.destroy();
eventManager.prefObserver.unregister();
});
window.addEventListener("keypress", eventManager.onKeyPress, true);
window.addEventListener("keydown", eventManager.onKeyUpOrDown, true);