1
\$\begingroup\$

I am using ParticleEffect with a texture stored inside TextureAtlas. The code below shows how I load a particle:

ParticleEffect particle = new ParticleEffect();
particle.load(Gdx.files.internal("particles/particle01.pe"), gamePlayAtlas);

I am not sure if I have to call particle.dispose() inside ApplicationLister's dispose method, or is it enough if I only call dispose on the AssetManager instance with which I loaded the TextureAtlas?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

If the ParticleEffect owns the texture you need to call dispose, and it owns it only if the texture is loaded using a FileHandle, so if it comes from TextureAtlas it doesn't own it and you don't need to call dispose.

But, the dispose method of ParticleEffect is aware of this so it's safe to call dispose even if it is not the owner of the texture.

ParticleEffect source code for the dispose method

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .