Committed by
GitHub
Properly dispose peer connection on RTC thread (#506)
* Properly dispose peer connection on RTC thread * changeset
正在显示
2 个修改的文件
包含
13 行增加
和
1 行删除
.changeset/angry-snails-breathe.md
0 → 100644
| @@ -35,6 +35,7 @@ import io.livekit.android.webrtc.CustomAudioProcessingFactory | @@ -35,6 +35,7 @@ import io.livekit.android.webrtc.CustomAudioProcessingFactory | ||
| 35 | import io.livekit.android.webrtc.CustomVideoDecoderFactory | 35 | import io.livekit.android.webrtc.CustomVideoDecoderFactory |
| 36 | import io.livekit.android.webrtc.CustomVideoEncoderFactory | 36 | import io.livekit.android.webrtc.CustomVideoEncoderFactory |
| 37 | import io.livekit.android.webrtc.peerconnection.executeBlockingOnRTCThread | 37 | import io.livekit.android.webrtc.peerconnection.executeBlockingOnRTCThread |
| 38 | +import io.livekit.android.webrtc.peerconnection.executeOnRTCThread | ||
| 38 | import livekit.org.webrtc.AudioProcessingFactory | 39 | import livekit.org.webrtc.AudioProcessingFactory |
| 39 | import livekit.org.webrtc.EglBase | 40 | import livekit.org.webrtc.EglBase |
| 40 | import livekit.org.webrtc.Logging | 41 | import livekit.org.webrtc.Logging |
| @@ -317,7 +318,13 @@ internal object RTCModule { | @@ -317,7 +318,13 @@ internal object RTCModule { | ||
| 317 | } | 318 | } |
| 318 | } | 319 | } |
| 319 | .createPeerConnectionFactory() | 320 | .createPeerConnectionFactory() |
| 320 | - .apply { memoryManager.registerClosable { dispose() } } | 321 | + .apply { |
| 322 | + memoryManager.registerClosable { | ||
| 323 | + executeOnRTCThread { | ||
| 324 | + dispose() | ||
| 325 | + } | ||
| 326 | + } | ||
| 327 | + } | ||
| 321 | } | 328 | } |
| 322 | } | 329 | } |
| 323 | 330 |
-
请 注册 或 登录 后发表评论