Browse Source

Merge pull request #2392 from nextcloud/fix-disposing-local-stream-when-the-call-activity-is-not-being-left

Fix disposing local stream when the call activity is not being left
Tim Krüger 2 năm trước cách đây
mục cha
commit
5bbd26028f

+ 8 - 8
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -1167,6 +1167,14 @@ public class CallActivity extends CallBaseActivity {
 
     @Override
     public void onDestroy() {
+        if (localStream != null) {
+            localStream.dispose();
+            localStream = null;
+            Log.d(TAG, "Disposed localStream");
+        } else {
+            Log.d(TAG, "localStream is null");
+        }
+
         if (!currentCallStatus.equals(CallStatus.LEAVING)) {
             hangup(true);
         }
@@ -1722,14 +1730,6 @@ public class CallActivity extends CallBaseActivity {
             endPeerConnection(sessionId, 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);
     }