Committed by
GitHub
Undo peer connection dispose change (#323)
正在显示
1 个修改的文件
包含
1 行增加
和
9 行删除
| @@ -36,10 +36,7 @@ import io.livekit.android.webrtc.getRtps | @@ -36,10 +36,7 @@ import io.livekit.android.webrtc.getRtps | ||
| 36 | import io.livekit.android.webrtc.isConnected | 36 | import io.livekit.android.webrtc.isConnected |
| 37 | import kotlinx.coroutines.CoroutineDispatcher | 37 | import kotlinx.coroutines.CoroutineDispatcher |
| 38 | import kotlinx.coroutines.CoroutineScope | 38 | import kotlinx.coroutines.CoroutineScope |
| 39 | -import kotlinx.coroutines.GlobalScope | ||
| 40 | import kotlinx.coroutines.SupervisorJob | 39 | import kotlinx.coroutines.SupervisorJob |
| 41 | -import kotlinx.coroutines.delay | ||
| 42 | -import kotlinx.coroutines.launch | ||
| 43 | import kotlinx.coroutines.runBlocking | 40 | import kotlinx.coroutines.runBlocking |
| 44 | import kotlinx.coroutines.sync.Mutex | 41 | import kotlinx.coroutines.sync.Mutex |
| 45 | import org.webrtc.* | 42 | import org.webrtc.* |
| @@ -268,12 +265,7 @@ constructor( | @@ -268,12 +265,7 @@ constructor( | ||
| 268 | isClosed.set(true) | 265 | isClosed.set(true) |
| 269 | peerConnection.close() | 266 | peerConnection.close() |
| 270 | 267 | ||
| 271 | - // Really ugly stop gap measure to avoid race conditions | ||
| 272 | - // TODO: Properly lock any PeerConnection resources to prevent usage. | ||
| 273 | - GlobalScope.launch { | ||
| 274 | - delay(10L * 1000) | ||
| 275 | - peerConnection.dispose() | ||
| 276 | - } | 268 | + // TODO: properly dispose of peer connection |
| 277 | } | 269 | } |
| 278 | } | 270 | } |
| 279 | 271 |
-
请 注册 或 登录 后发表评论