Missing release of webrtc surfaces

This commit is contained in:
Valere 2020-06-19 17:34:05 +02:00
parent bd19225219
commit 60998c9146
1 changed files with 8 additions and 1 deletions

View File

@ -103,6 +103,8 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
var systemUiVisibility = false
var surfaceRenderersAreInitialized = false
override fun doBeforeSetContentView() {
// Set window styles for fullscreen-window size. Needs to be done before adding content.
requestWindowFeature(Window.FEATURE_NO_TITLE)
@ -208,8 +210,12 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
}
override fun onDestroy() {
super.onDestroy()
peerConnectionManager.detachRenderers()
if (surfaceRenderersAreInitialized) {
pipRenderer.release()
fullscreenRenderer.release()
}
super.onDestroy()
turnScreenOffAndKeyguardOn()
}
@ -324,6 +330,7 @@ class VectorCallActivity : VectorBaseActivity(), CallControlsView.InteractionLis
pipRenderer.setOnClickListener {
callViewModel.handle(VectorCallViewActions.ToggleCamera)
}
surfaceRenderersAreInitialized = true
}
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {