0
0
mirror of https://github.com/Doodle3D/Doodle3D-Core.git synced 2025-05-10 09:23:23 +02:00

dispose editor controls on unmount

This commit is contained in:
casperlamboo 2017-11-06 14:40:19 +01:00
parent 1de8d84e36
commit 278a3a6c0a

@ -34,6 +34,10 @@ class DoodlePreview extends React.Component {
this.editorControls.addEventListener('change', () => scene.render());
}
componentWillUnmount() {
if (this.editorControls) this.editorControls.dispose();
}
componentDidUpdate(prevProps) {
const { scene } = this.state;
const { width, height } = this.props;