1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-21 07:35:47 +01:00

Add missing function name. Fix cleanup on window close. Fix minor mode change bug and add guards.

This commit is contained in:
Kris Maglione
2011-02-19 02:13:05 -05:00
parent 18f9b6908d
commit 77157eaff8
8 changed files with 193 additions and 168 deletions

View File

@@ -317,9 +317,12 @@ var Overlay = Module("Overlay", {
modules.events.listen(window, "unload", function onUnload() {
window.removeEventListener("unload", onUnload.wrapped, false);
for (let prop in properties(modules)) {
let desc = Object.getOwnPropertyDescriptor(modules, prop);
if (desc.value instanceof ModuleBase && "destroy" in desc.value)
util.trapErrors(desc.value.destroy, desc.value);
let mod = Object.getOwnPropertyDescriptor(modules, prop).value;
if (mod instanceof ModuleBase || mod && mod.isLocalModule) {
mod.stale = true;
if ("destroy" in mod)
util.trapErrors("destroy", mod);
}
}
}, false);
}