Skip to content

Call super.dispose() in Object3D subclasses for Three.js r186 - #413

Open
mrxz wants to merge 1 commit into
sparkjsdev:mainfrom
mrxz:object3d-dispose
Open

Call super.dispose() in Object3D subclasses for Three.js r186#413
mrxz wants to merge 1 commit into
sparkjsdev:mainfrom
mrxz:object3d-dispose

Conversation

@mrxz

@mrxz mrxz commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

There are a few descendant classes of Object3D in Spark that have their own dispose method. In the upcoming r186 release of Three.js, the base class will have a dispose method as well, so derived classes should call it (see mrdoob/three.js#34141).

This PR adds conditional calls to the base dispose method if present. This way the same code will work for the currently supported Three.js versions as well as the upcoming r186 and later. Since the types don't know about this new dispose method the @ts-ignore annotations are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant