Java – fragment variable ondestroy ()

There is already an answer to this question: > ondestroy() – to set or not to set instance variables to null? one

Solution

You don't have to worry about this GC will take care of it In Java, you almost have to have a memory leak (yes, it's possible, but very rare) So don't worry If you set the variable to null, you will end up wasting code time you don't need and will increase maintenance GC in Java does a lot of work to destroy variables and unreferenced objects

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>