Menu

#6 Activity memory leak caused by non-static inner thread

Unstable_(example)
closed
nobody
None
5
2022-09-05
2022-08-29
cuixiaoyi
No

An anonymous inner class will hold a reference to the this pointer of the outer class and will not be released until the thread ends.

com.ghostsq.commander.PictureViewer$LoaderThread

It will hold the Activity and prevent its timely release.
The anonymous thread can be replaced by static class with weakReference<pictureviewer> to update UI.</pictureviewer>

Discussion

  • cuixiaoyi

    cuixiaoyi - 2022-08-29

    Sorry, it is a wrong submit in patch. Pls close it

     
  • zc2

    zc2 - 2022-09-05
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.