Bug 1029735 - ContentSearch sometimes leaks event listeners and their closures (follow-up). r=ttaubert

This commit is contained in:
Drew Willcoxon 2014-06-24 13:38:13 -07:00
Родитель e62ad6fbc3
Коммит ef24c8b0ca
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -73,10 +73,11 @@ this.ContentSearch = {
// the meantime, then we need to update msg.target. event.detail will be
// the docshell's new parent <xul:browser> element.
msg.handleEvent = function (event) {
this.target.removeEventListener("SwapDocShells", this, true);
this.target = event.detail;
this.target.addEventListener("SwapDocShells", this, true);
};
msg.target.addEventListener("SwapDocShells", msg, true);
msg.originalTarget = msg.target;
this._eventQueue.push({
type: "Message",
@ -116,7 +117,7 @@ this.ContentSearch = {
if (methodName in this) {
yield this._initService();
yield this[methodName](msg, msg.data.data);
msg.originalTarget.removeEventListener("SwapDocShells", msg, true);
msg.target.removeEventListener("SwapDocShells", msg, true);
}
}),