www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 99d65926bf37687584027eed07a698c0bc08c921
parent 549fa4a508aed7aaae905703918f371da9c92943
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 20 Feb 2012 02:26:41 -0500

Unregister mimeTypeHandler and version header on Zotero shutdown

Diffstat:
Mchrome/content/zotero/xpcom/mimeTypeHandler.js | 5+++++
Mchrome/content/zotero/xpcom/zotero.js | 3++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/mimeTypeHandler.js b/chrome/content/zotero/xpcom/mimeTypeHandler.js @@ -39,6 +39,11 @@ Zotero.MIMETypeHandler = new function () { getService(Components.interfaces.nsIObserverService). addObserver(_Observer, "http-on-examine-response", false); this.initializeHandlers(); + Zotero.addShutdownListener(function() { + Components.classes["@mozilla.org/observer-service;1"]. + getService(Components.interfaces.nsIObserverService). + removeObserver(_Observer, "http-on-examine-response", false); + }); } /** diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -2234,6 +2234,7 @@ Zotero.VersionHeader = { if (Zotero.Prefs.get("zoteroDotOrgVersionHeader")) { this.register(); } + Zotero.addShutdownListener(this.unregister); }, // Called from this.init() and Zotero.Prefs.observe() @@ -2258,7 +2259,7 @@ Zotero.VersionHeader = { unregister: function () { var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - observerService.removeObserver(this, "http-on-modify-request"); + observerService.removeObserver(Zotero.VersionHeader, "http-on-modify-request"); } }