mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 22:41:02 +00:00
Bug 494973: Should remove installListener, r=mfinkle
This commit is contained in:
parent
774c3832f3
commit
aecc98f6e4
@ -247,6 +247,10 @@ var BrowserUI = {
|
||||
DownloadsView.init();
|
||||
},
|
||||
|
||||
uninit : function() {
|
||||
ExtensionsView.uninit();
|
||||
},
|
||||
|
||||
update : function(aState) {
|
||||
var icons = document.getElementById("urlbar-icons");
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user