Skip to content

Commit

Permalink
Properly dispose peer connection on RTC thread (#506)
Browse files Browse the repository at this point in the history
* Properly dispose peer connection on RTC thread

* changeset
  • Loading branch information
davidliu authored Sep 16, 2024
1 parent bcb54c6 commit 619cd4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/angry-snails-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"client-sdk-android": patch
---

Properly dispose peer connection on RTC thread
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import io.livekit.android.webrtc.CustomAudioProcessingFactory
import io.livekit.android.webrtc.CustomVideoDecoderFactory
import io.livekit.android.webrtc.CustomVideoEncoderFactory
import io.livekit.android.webrtc.peerconnection.executeBlockingOnRTCThread
import io.livekit.android.webrtc.peerconnection.executeOnRTCThread
import livekit.org.webrtc.AudioProcessingFactory
import livekit.org.webrtc.EglBase
import livekit.org.webrtc.Logging
Expand Down Expand Up @@ -317,7 +318,13 @@ internal object RTCModule {
}
}
.createPeerConnectionFactory()
.apply { memoryManager.registerClosable { dispose() } }
.apply {
memoryManager.registerClosable {
executeOnRTCThread {
dispose()
}
}
}
}
}

Expand Down

0 comments on commit 619cd4c

Please sign in to comment.