Bug 494973: Should remove installListener, r=mfinkle

This commit is contained in:
Hiroyuki Ikezoe 2009-05-26 21:46:44 -04:00
parent 774c3832f3
commit aecc98f6e4
3 changed files with 12 additions and 1 deletions

View File

@ -247,6 +247,10 @@ var BrowserUI = {
DownloadsView.init();
},
uninit : function() {
ExtensionsView.uninit();
},
update : function(aState) {
var icons = document.getElementById("urlbar-icons");

View File

@ -234,6 +234,8 @@ var Browser = {
},
shutdown: function() {
BrowserUI.uninit();
var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked");
os.removeObserver(gXPInstallObserver, "xpinstall-download-started");

View File

@ -57,6 +57,7 @@ var ExtensionsView = {
_msg: null,
_dloadmgr: null,
_restartCount: 0,
_observerIndex: -1,
_isXPInstallEnabled: function isXPInstallEnabled() {
let enabled = false;
@ -192,7 +193,7 @@ var ExtensionsView = {
this._extmgr = Cc["@mozilla.org/extensions/manager;1"].getService(Ci.nsIExtensionManager);
this._dloadmgr = new XPInstallDownloadManager();
this._extmgr.addInstallListener(this._dloadmgr);
this._observerIndex = this._extmgr.addInstallListener(this._dloadmgr);
// Now look and see if we're being opened by XPInstall
var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
@ -236,6 +237,10 @@ var ExtensionsView = {
}, 0);
},
uninit: function ev_uninit() {
this._extmgr.removeInstallListenerAt(this._observerIndex);
},
getAddonsFromLocal: function ev_getAddonsFromLocal() {
this.clearSection("local");