Skip to content

Conversation

@AdamEssenmacher
Copy link
Contributor

@AdamEssenmacher AdamEssenmacher commented Jan 14, 2024

Fixes #110

We need to be careful using the ViewTreeObserver getter. It can return different instances depending on where the view is in its lifecycle, resulting in events being unsubscribed from instances they were not subscribed to.

This PR converts the event subscription to using an explicit handler, which allows us to subscribe to the event using a weak reference back to the renderer and thus avoiding the memory leak.

@roubachof
Copy link
Owner

That's some quality PR here, thanks !

@roubachof roubachof closed this Jan 15, 2024
@roubachof roubachof reopened this Jan 15, 2024
@roubachof roubachof merged commit b2dc61d into roubachof:main Jan 15, 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.

Memory leak in Android CollectionView

2 participants