Skip to content

Commit fa783ef

Browse files
Fixed PeerConnectionTransport coroutine scope not being cancelled on close. (#818)
1 parent f568f96 commit fa783ef

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"client-sdk-android": patch
3+
---
4+
5+
Fixed PeerConnectionTransport coroutine scope not being cancelled on close.

livekit-android-sdk/src/main/java/io/livekit/android/room/PeerConnectionTransport.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import io.livekit.android.webrtc.peerconnection.launchBlockingOnRTCThread
4444
import kotlinx.coroutines.CoroutineDispatcher
4545
import kotlinx.coroutines.CoroutineScope
4646
import kotlinx.coroutines.SupervisorJob
47+
import kotlinx.coroutines.cancel
4748
import kotlinx.coroutines.runBlocking
4849
import livekit.org.webrtc.IceCandidate
4950
import livekit.org.webrtc.MediaConstraints
@@ -309,6 +310,7 @@ constructor(
309310
isClosed.set(true)
310311
peerConnection.dispose()
311312
}
313+
coroutineScope.cancel()
312314
}
313315

314316
fun updateRTCConfig(config: RTCConfiguration) {

0 commit comments

Comments
 (0)