Skip to content

fix Poolable object leak context issue#4502

Open
lbtrace wants to merge 1 commit intoPhilJay:masterfrom
lbtrace:master
Open

fix Poolable object leak context issue#4502
lbtrace wants to merge 1 commit intoPhilJay:masterfrom
lbtrace:master

Conversation

@lbtrace
Copy link
Copy Markdown

@lbtrace lbtrace commented Apr 20, 2019

PR Description

  • As we know ObjectPool cache some Poolable Objects, but some Poolable Object reference to View
    Object, and View Object reference to Context Object, And ObjectPool is static, so leak Context. For exsmple, ObjectPool.objects ---> AnimatedMoveViewJob.view ---> View.mContext ---> Context

  • For this issue, I Clear Poolable Object fields when Poolable Object is recycled. Please check patch code

  • I think lots of memory leak occurs when using MPAndroidChart, so please merge this patch.

@S0und
Copy link
Copy Markdown

S0und commented May 1, 2019

I would really appreciate this patch. Leakcanary caught the memory leak for me.

@NunoPontes
Copy link
Copy Markdown

Do you have a schedulle on when this will be in a new version?

@SubhrajyotiSen
Copy link
Copy Markdown

Merged this at https://github.com/SubhrajyotiSen/MPAndroidChart which will be an updated fork

@johnsabilla
Copy link
Copy Markdown

Hello, Leak Canary also detected this memory leak in our app. Any chance this PR will be merged soon?

@hannesa2
Copy link
Copy Markdown
Contributor

hannesa2 commented Oct 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants