superblocks-lab
superblocks-lab copied to clipboard
Fix setState and forceUpdate being called after closing an editor window
Environment/Browser
Version 1.1.0
Description
Closing an editor window that is still performing an action results in a warning.
Steps to reproduce
- Run any action in a given window e.g. Deploy
- 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 ofrun()
. - in
Compiler
:this.setState
in the_updateConsole()
is called after the component "closes". - in
Deployer
:this.setState
called in thecallback()
. - in
Deployer
:this.setState
in the_updateConsole()
is called after the component "closes". - in
Deployer
:this.forceUpdate
in theredraw()
is called after the component "closes". - in
PaneComponent
:this.forceUpdate
getting called inredraw()
. The redraw is called on close. - in
Window
:parent.redraw()
getting called in_clickedUpon()
.