From 3d76ba35710f541ebd482e68e03ff19875d36502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=BCger?= Date: Wed, 23 Feb 2022 12:34:04 +0100 Subject: [PATCH] Close localStream after peerConnection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The peerConnection get passed the tracks of the localStream. So to make sure that the tracks are not released before the connection is closed it will now done after closing the peerConnection. Signed-off-by: Tim Krüger --- .../nextcloud/talk/activities/CallActivity.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 7b3453cb2..36f6b9c69 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -1608,13 +1608,7 @@ public class CallActivity extends CallBaseActivity { peerConnectionFactory = null; } - if(localStream != null) { - localStream.dispose(); - localStream = null; - Log.d(TAG, "Disposed localStream"); - } else { - Log.d(TAG, "localStream is null"); - } + localAudioTrack = null; localVideoTrack = null; @@ -1628,6 +1622,14 @@ public class CallActivity extends CallBaseActivity { endPeerConnection(peerConnectionWrapperList.get(i).getSessionId(), false); } + if(localStream != null) { + localStream.dispose(); + localStream = null; + Log.d(TAG, "Disposed localStream"); + } else { + Log.d(TAG, "localStream is null"); + } + hangupNetworkCalls(shutDownView); ApplicationWideCurrentRoomHolder.getInstance().setInCall(false); }