-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential memory leak? #4
Comments
As a quick fix I made following changes in view in my project:
and:
With static handler nothing will stop gc from collecting view, and when it gets collected handler will just stop sending messages to itself. |
Aleksandrs, that looks great. I can't see any problems with the code. You should submit a pull request for review. Thanks. |
Hi guys, I have problems in a Samsung Galasy S3 device. I start spinning the progressWheel without problems, and even stopping it, if the screen of the phone turns off, the mobile phone doesn't come back from that state. I have also tried on a HTC One X and works like a charm. Some ideas? |
If we start spin it will forever post messages to handler (to update view). Since there are always messages in queue gc won't be able to collect this handler and therefore won't collect view and context it's attached to. So the only way to avoid leak is to call stop spin manually, which is troublesome in some situations.
Maybe view should override onDetachedFromWindow to stop message posting to handler, but save state, so on the next attach it will start spinning again.
The text was updated successfully, but these errors were encountered: