mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 11:15:47 +01:00
Some ensurance against :downloads cleanup handler not being called.
This commit is contained in:
@@ -198,9 +198,11 @@ var DownloadList = Class("DownloadList",
|
|||||||
for (let row in iter(services.downloadManager.DBConnection
|
for (let row in iter(services.downloadManager.DBConnection
|
||||||
.createStatement("SELECT id FROM moz_downloads")))
|
.createStatement("SELECT id FROM moz_downloads")))
|
||||||
this.addDownload(row.id);
|
this.addDownload(row.id);
|
||||||
|
},
|
||||||
|
initialize: function initialize() {
|
||||||
util.addObserver(this);
|
util.addObserver(this);
|
||||||
services.downloadManager.addListener(this);
|
services.downloadManager.addListener(this);
|
||||||
|
return this.nodes.list;
|
||||||
},
|
},
|
||||||
cleanup: function cleanup() {
|
cleanup: function cleanup() {
|
||||||
this.observe.unregister();
|
this.observe.unregister();
|
||||||
@@ -286,7 +288,7 @@ var Downloads = Module("downloads", {
|
|||||||
get: function params() downloads,
|
get: function params() downloads,
|
||||||
set: function params(val) { throw FailedAssertion("Not replacing mode change handler", 1) }
|
set: function params(val) { throw FailedAssertion("Not replacing mode change handler", 1) }
|
||||||
});
|
});
|
||||||
return downloads.nodes.list;
|
return downloads.initialize();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user