diff --git a/src/index.ts b/src/index.ts index 17e06d7..d969aa1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -504,6 +504,9 @@ class Renderer { * Destroy the renderer and its instances. */ destroy() { + // Handle cleanup of resize events + window.removeEventListener('resize', () => this.resize()); + this.instances.forEach((instance, key) => { instance.destroy(); this.instances.delete(key);