superblocks-lab icon indicating copy to clipboard operation
superblocks-lab copied to clipboard

Fix setState and forceUpdate being called after closing an editor window

Open filippsen opened this issue 6 years ago • 0 comments

Environment/Browser

Version 1.1.0

Description

Closing an editor window that is still performing an action results in a warning.

Steps to reproduce

  1. Run any action in a given window e.g. Deploy
  2. Close it during the processing

Expected result

Nothing.

Actual result

Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

Where to look at

Related state changes and force updates triggered when closing a window:

  • in Compiler: this.setState getting called at the end of run().
  • in Compiler: this.setState in the _updateConsole() is called after the component "closes".
  • in Deployer: this.setState called in the callback().
  • in Deployer: this.setState in the _updateConsole() is called after the component "closes".
  • in Deployer: this.forceUpdate in the redraw() is called after the component "closes".
  • in PaneComponent: this.forceUpdate getting called in redraw(). The redraw is called on close.
  • in Window: parent.redraw() getting called in _clickedUpon().

filippsen avatar Nov 15 '18 22:11 filippsen