Skip to content

Conversation

@renezuidhof
Copy link
Contributor

@renezuidhof renezuidhof commented May 18, 2022

As described in #105 I have memory leak issues when using a PowerSpinnerView.

I think this issue is caused because of the observers that are being added to the lifecycle, but not removed when updating 'lifecycleOwner' or destroying the view.

I've tested this for my project and it seems to fix the issue. Note: It is only fixed when I set the 'lifecycleOwner' myself:

powerSpinnerView.lifecycleOwner = MyView.findViewTreeLifecycleOwner()

Without setting it I still get a memory leak notification from LeakCanary. I think this is because of the lifecycleOwner that is being used at line 277. But I'm no expert on that part, so I might be wrong.
https://github.com/skydoves/PowerSpinner/blob/main/powerspinner/src/main/kotlin/com/skydoves/powerspinner/PowerSpinnerView.kt#L277.

@renezuidhof renezuidhof requested a review from skydoves as a code owner May 18, 2022 10:44
Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
Thank you for your contribution :)

@skydoves skydoves merged commit 97e232f into skydoves:main May 19, 2022
@renezuidhof
Copy link
Contributor Author

Great! Will you be releasing this to a new version?

@skydoves
Copy link
Owner

You can use this feature in the SNAPSHOT-1.2.2 build for now, I will release the next version as soon as possible.

@renezuidhof
Copy link
Contributor Author

I seem to have some troubles using that snapshot (it's not resolving). But that can be on my side, since I haven't used snapshots in my Android projects before.

Any thoughts on when you will release this?

@skydoves
Copy link
Owner

A new version 1.2.2 was released. Thanks!

@renezuidhof
Copy link
Contributor Author

Thanks!

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.

2 participants