More hardening

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-12 15:32:43 +01:00
parent ec7d2f58f6
commit e6cef58837
2 changed files with 8 additions and 0 deletions

View File

@ -1016,6 +1016,8 @@ public class CallActivity extends AppCompatActivity {
videoCapturer = null; videoCapturer = null;
} }
rootEglBase.release();
hangupNetworkCalls(); hangupNetworkCalls();
} }
@ -1207,6 +1209,8 @@ public class CallActivity extends AppCompatActivity {
MagicPeerConnectionWrapper magicPeerConnectionWrapper; MagicPeerConnectionWrapper magicPeerConnectionWrapper;
if ((magicPeerConnectionWrapper = getPeerConnectionWrapperForSessionId(sessionId)) != null) { if ((magicPeerConnectionWrapper = getPeerConnectionWrapperForSessionId(sessionId)) != null) {
runOnUiThread(() -> removeMediaStream(sessionId)); runOnUiThread(() -> removeMediaStream(sessionId));
magicPeerConnectionWrapper.removeMediaStream();
magicPeerConnectionWrapper.removePeerConnection();
deleteMagicPeerConnection(magicPeerConnectionWrapper); deleteMagicPeerConnection(magicPeerConnectionWrapper);
} }
} }

View File

@ -92,6 +92,10 @@ public class MagicPeerConnectionWrapper {
} }
} }
public void removePeerConnection() {
peerConnection.close();
peerConnection = null;
}
public void removeMediaStream() { public void removeMediaStream() {
if (peerConnection != null && localMediaStream != null) { if (peerConnection != null && localMediaStream != null) {
peerConnection.removeStream(localMediaStream); peerConnection.removeStream(localMediaStream);