Bug 1529845 - Add a destroy for the MarkupContextMenu. r=rcaliman

Differential Revision: https://phabricator.services.mozilla.com/D20783
This commit is contained in:
Gabriel Luong 2019-02-22 00:38:30 -05:00
Родитель 95d63e80b2
Коммит a5505820e9
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,16 @@ class MarkupContextMenu {
this.walker = this.inspector.walker;
}
destroy() {
this.markup = null;
this.inspector = null;
this.selection = null;
this.target = null;
this.telemetry = null;
this.toolbox = null;
this.walker = null;
}
show(event) {
if (!(event.originalTarget instanceof Element) ||
event.originalTarget.closest("input[type=text]") ||

Просмотреть файл

@ -2029,6 +2029,11 @@ MarkupView.prototype = {
this._hoveredContainer = null;
if (this._contextMenu) {
this._contextMenu.destroy();
this._contextMenu = null;
}
if (this._eventDetailsTooltip) {
this._eventDetailsTooltip.destroy();
this._eventDetailsTooltip = null;