From 8e16f87367e32fd8528e025258af22bd75b5584d Mon Sep 17 00:00:00 2001 From: Noeri Huisman <8823461+mrxz@users.noreply.github.com> Date: Wed, 26 Aug 2026 15:31:33 +0200 Subject: [PATCH] Call `super.dispose()` in Object3D subclasses for Three.js r186 --- src/SparkRenderer.ts | 3 +++ src/SplatMesh.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/SparkRenderer.ts b/src/SparkRenderer.ts index 01c9a4c3..6bcdd0af 100644 --- a/src/SparkRenderer.ts +++ b/src/SparkRenderer.ts @@ -672,6 +672,9 @@ export class SparkRenderer extends THREE.Mesh { } dispose() { + // @ts-ignore Object3D has a dispose method in Three.js >= r186 + super.dispose?.(); + if (this.target) { this.target.dispose(); this.target = undefined; diff --git a/src/SplatMesh.ts b/src/SplatMesh.ts index bfd42c90..9c696f68 100644 --- a/src/SplatMesh.ts +++ b/src/SplatMesh.ts @@ -563,6 +563,9 @@ export class SplatMesh extends SplatGenerator { // Call this when you are finished with the SplatMesh and want to free // any buffers it holds (via packedSplats). dispose() { + // @ts-ignore Object3D has a dispose method in Three.js >= r186 + super.dispose?.(); + if ( this.splats && this.splats !== this.packedSplats &&