feat: release the grain frame's shader mount through dispose(), the method ShaderMount actually exposes, so the WebGL context and canvas are really freed when a frame scrolls out of range instead of throwing on a missing disconnect() and leaking every context

This commit is contained in:
Matthew Meszaros
2026-09-02 08:46:01 -07:00
parent e6d615beb2
commit f3a4d09f0b
+2 -2
View File
@@ -122,8 +122,8 @@ const t = GRAIN_TONES[tone];
}
// Frees the GL context and its canvas; the CSS gradient stays underneath.
function unmount(el: HTMLElement) {
const m = (el as HTMLElement & { paperShaderMount?: { disconnect: () => void } }).paperShaderMount;
if (m) m.disconnect();
const m = (el as HTMLElement & { paperShaderMount?: { dispose: () => void } }).paperShaderMount;
if (m) m.dispose();
delete el.dataset.grainReady;
}