()
| 541 | */ |
| 542 | let cleanedUp = false; |
| 543 | const cleanup = (): void => { |
| 544 | if (cleanedUp) return; |
| 545 | cleanedUp = true; |
| 546 | |
| 547 | if (rafId !== null) cancelAnimationFrame(rafId); |
| 548 | ro.disconnect(); |
| 549 | disposeSliderUi(); |
| 550 | coordinator?.dispose(); |
| 551 | coordinator = null; |
| 552 | gpuContext?.destroy(); |
| 553 | gpuContext = null; |
| 554 | canvas.remove(); |
| 555 | }; |
| 556 | |
| 557 | try { |
| 558 | // Establish initial canvas size before WebGPU init so GPUContext sees non-zero dimensions. |
no test coverage detected