-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Memory leaked with Skybox and IndirectLight on Android #6412
Comments
Note: this only happens with the utility functions. |
Thanks for the report. This is a bad one, basically the API is broken. |
We can fix it easily in the Java case. Instead of a single long we should return two (the two pointers) and have the Java layer perform the additional destroy as needed. |
@romainguy I don't think it will work, because the java (kotlin actually) layer doesn't store the long, it just returns it to the caller:
This is completely stateless. |
We can store that in the Java IndirectLight object. It's very doable. |
Okay but we now made all the Java objects bigger just to support that broken API -- And we're breaking the model of java objects being "dumb", now these have logic. |
circling back after two years. I think we can just make |
We break existing API by returning both the IndirectLight and the texture. Same thing with Skybox. Fix one bug where the float array in getSphericalHarmonics wasn't getting written out. Fixes #6412
We break existing API by returning both the IndirectLight and the texture. Same thing with Skybox. Fix one bug where the float array in getSphericalHarmonics wasn't getting written out. Fixes #6412
As the picture showing, Creating
Skybox
orIndirectLight
byKTXLoader.createXXX
will createcubemap
Texture.Normally, we may use
Engine.destroy
to release theSkybox
orIndirectLight
, but thecubemap
Texture will not be destroyed unless the engine is destroyed or destroying thecubemap
Texture explicitly(it is very oddly because nobody can realize it).The text was updated successfully, but these errors were encountered: