зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1029735 - ContentSearch sometimes leaks event listeners and their closures (follow-up). r=ttaubert
This commit is contained in:
Родитель
e62ad6fbc3
Коммит
ef24c8b0ca
|
@ -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);
|
||||
}
|
||||
}),
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче