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 &&