Bug 1484595 - Remove the HTMLTooltip hidden event listener before destroying the HTMLTooltip. r=birtles
☠☠ backed out by 41993cf46d6a ☠ ☠
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Mon, 20 Aug 2018 07:03:07 +0000
changeset 432329 fc5c57e9b65b65e98fdc8e792913a5553bb67897
parent 432328 1aa8b1865c770f3b3a48bbda953ce5d38f69dd45
child 432330 5bc36aec6368b3ae076d7b6cc7e821b3fc260385
push id67963
push usermantaroh@gmail.com
push dateMon, 20 Aug 2018 07:05:15 +0000
treeherderautoland@fc5c57e9b65b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1484595
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484595 - Remove the HTMLTooltip hidden event listener before destroying the HTMLTooltip. r=birtles MenuButton will listen the HTMLTooltip hidden event even if HTMLTooltip is destroyed. As a result of it, the timer which issued in the MenuButton's event listener might fail due to the target window is destroyed. (e.g., switching the dock mode to bottom from window mode.) This patch will remove this event listener before destroying the HTMLTooltip. Differential Revision: https://phabricator.services.mozilla.com/D3759
devtools/client/shared/components/menu/MenuButton.js
--- a/devtools/client/shared/components/menu/MenuButton.js
+++ b/devtools/client/shared/components/menu/MenuButton.js
@@ -121,18 +121,18 @@ class MenuButton extends PureComponent {
   async resetTooltip() {
     if (!this.tooltip) {
       return;
     }
 
     // Mark the menu as closed since the onHidden callback may not be called in
     // this case.
     this.setState({ expanded: false });
+    this.tooltip.off("hidden", this.onHidden);
     this.tooltip.destroy();
-    this.tooltip.off("hidden", this.onHidden);
     this.tooltip = null;
   }
 
   async showMenu(anchor) {
     this.setState({
       expanded: true
     });