From 60998c914625671875606d912941096677fc0565 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 19 Jun 2020 17:34:05 +0200 Subject: [PATCH] Missing release of webrtc surfaces --- .../im/vector/riotx/features/call/VectorCallActivity.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/call/VectorCallActivity.kt b/vector/src/main/java/im/vector/riotx/features/call/VectorCallActivity.kt index 1921dfe3da..a1247c4390 100644 --- a/vector/src/main/java/im/vector/riotx/features/call/VectorCallActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/call/VectorCallActivity.kt @@ -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 {