mcxiaoke / android-volley

DEPRECATED
4.29k stars 1.56k forks source link

mErrorListener, mListener should be nulled whenever request is cancelled #93

Closed haol1u closed 9 years ago

haol1u commented 9 years ago

Please refer to this link: https://stackoverflow.com/questions/26599636/should-i-worry-about-memory-leaks-and-using-weakreference-with-volley-in-android#_=_

RobertoAlvarezCeballos commented 9 years ago

I've seen the same issue on my code. So far the latest version of Volley still doesn't fix it for me. I'll try to clean the listeners on the cancel method.

haol1u commented 9 years ago

@RobertoIDL Here is solution for this. Design a subclass which inherits from Request, and define your own errorListener there instead of using the one in Base Class. Then whenever your request finishes, you have full control to clear the errorListener you defined.

RobertoAlvarezCeballos commented 9 years ago

Thanks @leo524891010 that's what I've done and it's working fine. Just for the record I've found another potential leak due to the VolleyLog class and the method finalize()

mcxiaoke commented 9 years ago

fixed in 1.0.19