mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
Better clean up
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
5090660068
commit
0e78d0f64d
@ -940,7 +940,9 @@ public class CallActivity extends AppCompatActivity {
|
||||
|
||||
private void deleteMagicPeerConnection(MagicPeerConnectionWrapper magicPeerConnectionWrapper) {
|
||||
if (magicPeerConnectionWrapper.getPeerConnection() != null) {
|
||||
magicPeerConnectionWrapper.removeMediaStream();
|
||||
magicPeerConnectionWrapper.getPeerConnection().close();
|
||||
magicPeerConnectionWrapper.getPeerConnection().dispose();
|
||||
}
|
||||
magicPeerConnectionWrapperList.remove(magicPeerConnectionWrapper);
|
||||
}
|
||||
@ -977,7 +979,6 @@ public class CallActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!dueToNetworkChange) {
|
||||
pipVideoView.release();
|
||||
|
||||
@ -989,8 +990,13 @@ public class CallActivity extends AppCompatActivity {
|
||||
if (localMediaStream.audioTracks != null && localMediaStream.audioTracks.size() > 0) {
|
||||
localMediaStream.removeTrack(localMediaStream.audioTracks.get(0));
|
||||
}
|
||||
|
||||
localMediaStream.dispose();
|
||||
}
|
||||
|
||||
localVideoTrack.dispose();
|
||||
localAudioTrack.dispose();
|
||||
|
||||
localVideoTrack = null;
|
||||
localAudioTrack = null;
|
||||
localRenderer = null;
|
||||
|
@ -92,6 +92,12 @@ public class MagicPeerConnectionWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeMediaStream() {
|
||||
if (peerConnection != null && localMediaStream != null) {
|
||||
peerConnection.removeStream(localMediaStream);
|
||||
}
|
||||
}
|
||||
|
||||
public void drainIceCandidates() {
|
||||
|
||||
for (IceCandidate iceCandidate : iceCandidates) {
|
||||
|
Loading…
Reference in New Issue
Block a user