Close localStream after peerConnection

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 <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2022-02-23 12:34:04 +01:00
parent f08a9ef463
commit 3d76ba3571
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E

View File

@ -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);
}