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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ fun VideoRenderer(

DisposableEffect(currentCompositeKeyHash.toString()) {
onDispose {
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

}
view = null
boundVideoTrack = null
}
}

Expand Down