mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-23 10:17:02 +02:00
fix: memory leak - scene.destroy() and window.launchQueue (#8198)
This commit is contained in:
@@ -2490,7 +2490,9 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
(window as any).launchQueue?.setConsumer(() => {});
|
||||||
this.renderer.destroy();
|
this.renderer.destroy();
|
||||||
|
this.scene.destroy();
|
||||||
this.scene = new Scene();
|
this.scene = new Scene();
|
||||||
this.fonts = new Fonts({ scene: this.scene });
|
this.fonts = new Fonts({ scene: this.scene });
|
||||||
this.renderer = new Renderer(this.scene);
|
this.renderer = new Renderer(this.scene);
|
||||||
@@ -2499,7 +2501,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.resizeObserver?.disconnect();
|
this.resizeObserver?.disconnect();
|
||||||
this.unmounted = true;
|
this.unmounted = true;
|
||||||
this.removeEventListeners();
|
this.removeEventListeners();
|
||||||
this.scene.destroy();
|
|
||||||
this.library.destroy();
|
this.library.destroy();
|
||||||
this.laserTrails.stop();
|
this.laserTrails.stop();
|
||||||
this.eraserTrail.stop();
|
this.eraserTrail.stop();
|
||||||
|
Reference in New Issue
Block a user