1
\$\begingroup\$

The LibGDX Actor does not have a dispose method, though it has a texture. Do I need to call dispose on its texture?

\$\endgroup\$
2
\$\begingroup\$

You call dispose() when you no longer need the resource. This is to free up the memory that the resource had been using. So yes, you need to call dispose when you're finished using your object.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Does this apply to the Actor's texture? The Actor class itself does not have a dispose method to call. \$\endgroup\$ – Hello World Jul 30 '17 at 13:50
  • \$\begingroup\$ @HelloWorld Yes, this applies to all resources that can be disposed. Texture can be disposed so it should be disposed. \$\endgroup\$ – Charanor Jul 30 '17 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.