Browse Source

fix: memory leak - scene.destroy() and window.launchQueue (#8198)

pull/8201/head
zsviczian 1 year ago committed by GitHub
parent
commit
2e1f08c796
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      packages/excalidraw/components/App.tsx

3
packages/excalidraw/components/App.tsx

@ -2490,7 +2490,9 @@ class App extends React.Component<AppProps, AppState> { @@ -2490,7 +2490,9 @@ class App extends React.Component<AppProps, AppState> {
}
public componentWillUnmount() {
(window as any).launchQueue?.setConsumer(() => {});
this.renderer.destroy();
this.scene.destroy();
this.scene = new Scene();
this.fonts = new Fonts({ scene: this.scene });
this.renderer = new Renderer(this.scene);
@ -2499,7 +2501,6 @@ class App extends React.Component<AppProps, AppState> { @@ -2499,7 +2501,6 @@ class App extends React.Component<AppProps, AppState> {
this.resizeObserver?.disconnect();
this.unmounted = true;
this.removeEventListeners();
this.scene.destroy();
this.library.destroy();
this.laserTrails.stop();
this.eraserTrail.stop();

Loading…
Cancel
Save