Skin Layers 3D (Fabric/Forge)

Skin Layers 3D (Fabric/Forge)

44M Downloads

Potential memory leak

coderbot16 opened this issue ยท 3 comments

commented

SkinUtil calls NativeImage#untrack(), seemingly in an attempt to deallocate the NativeImage object:

However, NativeImage#untrack() does not deallocate the texture - rather, it removes it from LWJGL's leak tracking, meaning that not only does this code potentially leak memory, it does so in a way that is invisible to LWJGL's debugging tools.

It seems like you intended to call NativeImage#close().

commented

Thanks for that info. That's quite an unfortunate name, I'll fix it across my projects.

commented

You're welcome, and yeah, I wish the name were a little more indicative of what it does, maybe it would be nicer if it were named NativeImage#leakSilently() instead.

commented

In the end it leaks 1-5kb of memory(once per loaded player), so I doubt anyone managed to crash their game with this yet, but still better to fix this^^.