简体   繁体   中英

Disposing Screens in LibGdx

When handling screens in libGdx do you only need to dispose any ressources used within the screen (like Textures, Sounds, Sprites etc.) or do you also need to do anything with the screen object itself?
I searched a bit, but I couldn't really find an answer to this question. I would assume the answer is no and the Garbage Collector will tend to the object like any other object, but I just want to be sure I'm not missing anything libGdx specific.

You do not need to dispose Screen objects in Libgdx. Screen objects do not load any resources into memory, it is merely a Logical class that ApplicationAdapter uses to delegate work to.

Look at this Memory Management wiki section, they provide a list of classes that require to be manually disposed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM