Skip to content
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

Fixed memory leak - LeakCanary leak detection io.livekit.android.rend… #325

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

serhiynovos
Copy link

I noticed that sometimes when my app leaves a call, LeakCanary shows that memory leak is detected. After these changes I stopped seeing this message

This PR should fix #324 issue

@serhiynovos
Copy link
Author

@davidliu I'm thinking if it could not be issue of random crashes on peerConnection dispose as looks like it had references to tracks and some native memory may leak which could case that something wanted to access peerconneection which was not in memory anymore

view?.release()
view?.let {
it.release()
videoTrack?.removeRenderer(it)
Copy link
Contributor

@davidliu davidliu Nov 23, 2023

Choose a reason for hiding this comment

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

Hmm, is the cleanupVideoTrack() not getting called for you? That's essentially what this is doing, so it seems redundant since should be called in the previous onDispose on line 80.

Copy link
Author

Choose a reason for hiding this comment

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

I'll test more. But only after these changes I stopped getting leak notification

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.

LeakCanary leak detection io.livekit.android.renderer.TextureViewRenderer
2 participants