davidliu
Committed by GitHub

Undo peer connection dispose change (#323)

... ... @@ -36,10 +36,7 @@ import io.livekit.android.webrtc.getRtps
import io.livekit.android.webrtc.isConnected
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
import org.webrtc.*
... ... @@ -268,12 +265,7 @@ constructor(
isClosed.set(true)
peerConnection.close()
// Really ugly stop gap measure to avoid race conditions
// TODO: Properly lock any PeerConnection resources to prevent usage.
GlobalScope.launch {
delay(10L * 1000)
peerConnection.dispose()
}
// TODO: properly dispose of peer connection
}
}
... ...