Ikemen-GO icon indicating copy to clipboard operation
Ikemen-GO copied to clipboard

OpenGL C library memory leak at SFFv2 loading.

Open Windblade-GR01 opened this issue 3 years ago • 1 comments

Currently when loading SFFv2. At first glance, the code that causes it is at image.go#L558.

More info is needed on why the leak happens.

Windblade-GR01 avatar May 23 '21 06:05 Windblade-GR01

I think the code in image.go is just a symptom of the leak, not its root cause. From what I can observe, if the Sff object is destroyed, the textures are properly released as well.

However I have seen occurrences of Sff objects not being destroyed when they’re being used by a Helper. I will investigate more and post my findings.

Aside from that, relying on the GC to release textures does not seem like a good idea. 32-bit textures may be huge, but from the GC’s point of view, each of them occupies only a few bytes. It may decide that they’re not worth freeing.

samhocevar avatar Apr 25 '22 16:04 samhocevar