From d144e9c4832db9292bd425e9b214d612ee2f6805 Mon Sep 17 00:00:00 2001 From: Serhiy Novoseletskiy Date: Mon, 20 Nov 2023 18:35:33 +0200 Subject: [PATCH] Fixed memory leak - LeakCanary leak detection io.livekit.android.renderer.TextureViewRenderer --- .../main/java/io/livekit/android/compose/VideoRenderer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/livekit-android-sdk/src/main/java/io/livekit/android/compose/VideoRenderer.kt b/livekit-android-sdk/src/main/java/io/livekit/android/compose/VideoRenderer.kt index f7e34e4d..1888151e 100644 --- a/livekit-android-sdk/src/main/java/io/livekit/android/compose/VideoRenderer.kt +++ b/livekit-android-sdk/src/main/java/io/livekit/android/compose/VideoRenderer.kt @@ -83,7 +83,12 @@ fun VideoRenderer( DisposableEffect(currentCompositeKeyHash.toString()) { onDispose { - view?.release() + view?.let { + it.release() + videoTrack?.removeRenderer(it) + } + view = null + boundVideoTrack = null } }