mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-11 08:06:13 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user