Bug 1359849 - Guard against exceptions thrown while cleaning up the video controls. r=gijs

MozReview-Commit-ID: 2cwIE7Xdp7O
This commit is contained in:
Jared Wein 2017-04-26 12:36:34 -04:00
Родитель 9c8fde7730
Коммит 9884d1f36d
1 изменённых файлов: 23 добавлений и 11 удалений

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

@ -715,17 +715,21 @@
terminateEventListeners() {
if (this.videoEvents) {
for (let event of this.videoEvents) {
try {
this.video.removeEventListener(event, this, {
capture: true,
mozSystemGroup: true
});
} catch (ex) {}
}
}
if (this.controlListeners) {
for (let element of this.controlListeners) {
try {
element.item.removeEventListener(element.event, element.func,
{ mozSystemGroup: true, capture: element.capture });
} catch (ex) {}
}
delete this.controlListeners;
@ -2041,7 +2045,9 @@
handleEvent(aEvent) {
if (aEvent.type == "transitionend") {
this.firstShow = false;
try {
this.videocontrols.removeEventListener("transitionend", this);
} catch (ex) {}
return;
}
@ -2052,7 +2058,9 @@
terminateEventListeners() {
for (var event of this.videoEvents) {
try {
this.Utils.video.removeEventListener(event, this);
} catch (ex) {}
}
},
@ -2197,12 +2205,16 @@
controlListeners: [],
terminateEventListeners() {
for (let event of this.videoEvents) {
try {
this.video.removeEventListener(event, this, { mozSystemGroup: true });
} catch (ex) {}
}
for (let element of this.controlListeners) {
try {
element.item.removeEventListener(element.event, element.func,
{ mozSystemGroup: true });
} catch (ex) {}
}
delete this.controlListeners;