зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1465635 - Ensure removing BrowsingContextTarget front events when destroying it. r=jdescottes
When destroying the target, Target.destroy (for local tabs) only calls DebuggerClient.close, which isn't going to call `detach`. But we still do need to unregister the tabNavigated/frameUpdate listener to prevent unecessary event from firing. Depends on D17609 Differential Revision: https://phabricator.services.mozilla.com/D17610 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6483fbf5a1
Коммит
0b98a1f393
|
@ -169,6 +169,17 @@ class BrowsingContextTargetFront extends
|
|||
|
||||
return response;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
const promise = super.destroy();
|
||||
|
||||
// As detach isn't necessarily called on target's destroy
|
||||
// (it isn't for local tabs), ensure removing listeners set in attach.
|
||||
this.off("tabNavigated", this._onTabNavigated);
|
||||
this.off("frameUpdate", this._onFrameUpdate);
|
||||
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
exports.BrowsingContextTargetFront = BrowsingContextTargetFront;
|
||||
|
|
Загрузка…
Ссылка в новой задаче