Can't clear DynamicTexture to transparent in BabylonReactNative

Yeah good point, I’ve checked without the ondispose event handler, but it also happens then.

I’ve created this playground, where I’ve put my adapted code:

I’ve not done this before, but from what I can tell it doesn’t seem to happen there, I’ve profiled with the chrome tools and got this graph.


Since, in this playground I get the texture straight from the material instead of from a more global variable I’ve changed that in my original script. But I still get the same memory behaviour in React Native.

Hmm, so I’m just changing up the configurations and I can also get a memory leak without disposing and creating textures. It’s hard to say if that’s just when interacting with the canvas or when calling the drawtext. But it’s one of the two, when I remove both of them, there’s not leak anymore.
It seems like it’s due to multiple calls to canvas.measureText, that I’m using to get the text to wrap.