Closed AquilaAbriel closed 10 months ago
Could try also adding pt3.close();
and/or System.gc();
to the loop to debug further.
Oh my god... that was quick! And it fixed the memory leak ^^ All I had to do was to close the Paint object. You are just awesome, thank you very much.
I'm currently trying to implement a runtime effect which uses runtime generated images as shader inputs. I tried to replicate the RuntimeEffectScene example: https://github.com/HumbleUI/Skija/blob/master/examples/scenes/src/RuntimeEffectScene.java
But instead of a static texture image from a file, I wanted to use runtime created images drawn to offscreen surfaces. My implementation "works" (The output looks like what I expected), but it also introduced a memory leak issue. I tried to track down the leaking object, but so far with no avail. Maybe my approach is simply wrong... If somebody could help me figure this out, that would be awesome.
Some minimalist code to showcase my current implementation:
The OffscreenTarget.dispose() method just calls Surface.close() on the encapsulated Skija Surface.