Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Dispose #14

Closed
eXponenta opened this issue Mar 21, 2022 · 1 comment
Closed

[feature] Dispose #14

eXponenta opened this issue Mar 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@eXponenta
Copy link
Contributor

Dispose is required because we can't know when React kill node or only replace it.
For mesh this is critical, because Geometry allocating GPU memory, Textures too, and other GL objects.

Suggest add to this:
https://github.com/pmndrs/react-ogl/blob/main/src/reconciler.ts#L121

Or remove call:

https://github.com/oframe/ogl/blob/master/src/core/Program.js#L208
https://github.com/oframe/ogl/blob/master/src/core/Geometry.js#L266

Or dispose call with nullish check, dispose or destroy is convential, and can be implemented in subclasses.

@CodyJasonBennett
Copy link
Member

Implemented in #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants