Bug 1472366 - Remove listeners in ToolboxTabs on unmount. r=mantaroh
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 03 Jul 2018 01:52:25 +0000
changeset 424949 984abfb799a1b8a484a3ed4a58ee4aa919b0c841
parent 424948 f5bfc9971285d5edcf12e4610d521eb4bedf7a59
child 424950 06da5e793b2c896f9d8ce7043c860ddd84231511
push id104946
push userrgurzau@mozilla.com
push dateWed, 04 Jul 2018 10:03:16 +0000
treeherdermozilla-inbound@796893f4d2f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmantaroh
bugs1472366
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 1472366 - Remove listeners in ToolboxTabs on unmount. r=mantaroh ToolboxTabs can leave some listeners still bound after unmount leading to errors during test runs. Differential Revision: https://phabricator.services.mozilla.com/D1892
devtools/client/framework/components/ToolboxTabs.js
--- a/devtools/client/framework/components/ToolboxTabs.js
+++ b/devtools/client/framework/components/ToolboxTabs.js
@@ -70,16 +70,18 @@ class ToolboxTabs extends Component {
   componentDidUpdate(prevProps, prevState) {
     if (this.shouldUpdateToolboxTabs(prevProps, this.props)) {
       this.updateCachedToolTabsWidthMap();
       this.updateOverflowedTabs();
     }
   }
 
   componentWillUnmount() {
+    window.removeEventListener("resize", this.resizeHandler);
+    window.cancelIdleCallback(this._resizeTimerId);
     this._tabsOrderManager.destroy();
   }
 
   /**
    * Check if two array of ids are the same or not.
    */
   equalToolIdArray(prevPanels, nextPanels) {
     if (prevPanels.length !== nextPanels.length) {