mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-01 21:25:45 +01:00
Fix some cleanup issues with multiple windows.
This commit is contained in:
@@ -65,6 +65,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
|
this.observe.unregister();
|
||||||
autocommands.trigger("LeavePre", {});
|
autocommands.trigger("LeavePre", {});
|
||||||
dactyl.triggerObserver("shutdown", null);
|
dactyl.triggerObserver("shutdown", null);
|
||||||
util.dump("All dactyl modules destroyed\n");
|
util.dump("All dactyl modules destroyed\n");
|
||||||
@@ -98,9 +99,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
this.trapErrors("destroy", mod, reason);
|
this.trapErrors("destroy", mod, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let mod in values(modules.ownPropertyValues.reverse()))
|
modules.moduleManager.initDependencies("cleanup");
|
||||||
if (mod instanceof Class && "INIT" in mod && "cleanup" in mod.INIT)
|
|
||||||
this.trapErrors(mod.cleanup, mod, dactyl, modules, window, reason);
|
|
||||||
|
|
||||||
for (let name in values(Object.getOwnPropertyNames(modules).reverse()))
|
for (let name in values(Object.getOwnPropertyNames(modules).reverse()))
|
||||||
try {
|
try {
|
||||||
@@ -1129,7 +1128,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
return func.apply(self || this, Array.slice(arguments, 2));
|
return func.apply(self || this, Array.slice(arguments, 2));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
dactyl.reportError(e, true);
|
try {
|
||||||
|
dactyl.reportError(e, true);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
util.reportError(e);
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user