From e0b60e4320ca5518f4522ae85d7e7b1c9cb07f77 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:17:52 +1000 Subject: [PATCH] fix(ui): properly destroy entities in manager cleanup --- .../src/features/controlLayers/konva/CanvasManager.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasManager.ts b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasManager.ts index c0c578eeef..2d91a78577 100644 --- a/invokeai/frontend/web/src/features/controlLayers/konva/CanvasManager.ts +++ b/invokeai/frontend/web/src/features/controlLayers/konva/CanvasManager.ts @@ -605,6 +605,16 @@ export class CanvasManager { return () => { this.log.debug('Cleaning up konva renderer'); + this.inpaintMask.destroy(); + for (const region of this.regions.values()) { + region.destroy(); + } + for (const layer of this.layers.values()) { + layer.destroy(); + } + for (const controlAdapter of this.controlAdapters.values()) { + controlAdapter.destroy(); + } unsubscribeRenderer(); unsubscribeListeners(); unsubscribeShouldShowStagedImage();