Bug 1378790 - Remove keyboard navigation event listeners when a photonpanelmultiview instance is destroyed. r?Gijs
MozReview-Commit-ID: JcAUwLClq7M
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -325,19 +325,21 @@ this.PanelMultiView = class {
this._moveOutKids(this._subViews);
if (this.panelViews) {
this._moveOutKids(this._viewStack);
this.panelViews.clear();
} else {
this._clickCapturer.removeEventListener("click", this);
}
+ this._panel.removeEventListener("mousemove", this);
this._panel.removeEventListener("popupshowing", this);
this._panel.removeEventListener("popupshown", this);
this._panel.removeEventListener("popuphidden", this);
+ this.window.removeEventListener("keydown", this);
this.node.dispatchEvent(new this.window.CustomEvent("destructed"));
this.node = this._clickCapturer = this._viewContainer = this._mainViewContainer =
this._subViews = this._viewStack = this.__dwu = this._panelViewCache = null;
}
/**
* Remove any child subviews into the panelViewCache, to ensure
* they remain usable even if this panelmultiview instance is removed