feat(ui): abort controller in SAM module when destroying

This commit is contained in:
psychedelicious 2024-10-23 20:05:39 +10:00 committed by Kent Keirsey
parent c08075946a
commit bc954b9996

View File

@ -779,6 +779,10 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
destroy = () => {
this.log.debug('Destroying module');
if (this.abortController && !this.abortController.signal.aborted) {
this.abortController.abort();
}
this.abortController = null;
this.unsubscribe();
this.konva.group.destroy();
};