1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 09:12:28 +01:00

Tie storage observers to a weak reference of window so they're automatically destroyed.

This commit is contained in:
Kris Maglione
2008-12-20 14:36:11 -05:00
parent e1d5236261
commit ef827139e4
3 changed files with 21 additions and 13 deletions

View File

@@ -236,10 +236,7 @@ function Bookmarks() //{{{
};
var cache = storage.newObject("bookmark-cache", Cache, false);
storage.addObserver("bookmark-cache", bookmarkObserver);
liberator.registerObserver("shutdown", function () {
storage.removeObserver("bookmark-cache", bookmarkObserver);
});
storage.addObserver("bookmark-cache", bookmarkObserver, window);
liberator.registerObserver("enter", function () {
if (options["preload"])