Native memory leak: pixmaps are never released
dar-dev opened this issue · 4 comments
dar-dev commented
Pixmaps are never released after loading glTF images, see:
Here's a simple test code to replicate:
for (;;)
{
final GLBLoader loader = new GLBLoader();
SceneAsset asset = loader.load(Gdx.files.absolute(filename), true);
Thread.sleep(100);
loader.dispose();
asset.dispose();
}
dar-dev commented
That's good.
Now, how can I avoid the pixmap loading when loading glTF textures? (are pixmaps needed?)
--
mgsx-dev commented
Yes, that was the purpose of the change : sometimes you want to get texture pixels. And they were disposed at the wrong time.
If you don't want to keep them, you could dispose them after SceneAsset loading (by disposing them and nullify the array)
mgsx-dev commented
no, you need to decode PNG/JPG into Pixmap prior to upload pixels to GPU.