mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +01:00
Improvements to cleanup
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
2e6804dc35
commit
b7539bfc12
@ -978,31 +978,37 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
if (!dueToNetworkChange) {
|
if (!dueToNetworkChange) {
|
||||||
pipVideoView.release();
|
pipVideoView.release();
|
||||||
|
|
||||||
if (localMediaStream != null) {
|
if (audioSource != null) {
|
||||||
if (localMediaStream.videoTracks != null && localMediaStream.videoTracks.size() > 0) {
|
audioSource.dispose();
|
||||||
localMediaStream.removeTrack(localMediaStream.videoTracks.get(0));
|
audioSource = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localMediaStream.audioTracks != null && localMediaStream.audioTracks.size() > 0) {
|
if (audioManager != null) {
|
||||||
localMediaStream.removeTrack(localMediaStream.audioTracks.get(0));
|
audioManager.stop();
|
||||||
}
|
audioManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (videoCapturer != null) {
|
||||||
|
try {
|
||||||
|
videoCapturer.stopCapture();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Log.e(TAG, "Failed to stop capturing while hanging up");
|
||||||
|
}
|
||||||
|
videoCapturer.dispose();
|
||||||
|
videoCapturer = null;
|
||||||
|
}
|
||||||
|
|
||||||
localVideoTrack = null;
|
Log.d(TAG, "Closing video source.");
|
||||||
localAudioTrack = null;
|
if (videoSource != null) {
|
||||||
localRenderer = null;
|
videoSource.dispose();
|
||||||
localMediaStream = null;
|
videoSource = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (peerConnectionFactory != null) {
|
if (peerConnectionFactory != null) {
|
||||||
peerConnectionFactory.dispose();
|
peerConnectionFactory.dispose();
|
||||||
peerConnectionFactory = null;
|
peerConnectionFactory = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (videoCapturer != null) {
|
|
||||||
videoCapturer.dispose();
|
|
||||||
videoCapturer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
hangupNetworkCalls();
|
hangupNetworkCalls();
|
||||||
|
|
||||||
|
@ -93,8 +93,13 @@ public class MagicPeerConnectionWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removePeerConnection() {
|
public void removePeerConnection() {
|
||||||
|
if (magicDataChannel != null) {
|
||||||
|
magicDataChannel.dispose();
|
||||||
|
magicDataChannel = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (peerConnection != null) {
|
if (peerConnection != null) {
|
||||||
peerConnection.close();
|
peerConnection.dispose();
|
||||||
peerConnection = null;
|
peerConnection = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user