Fix cleanups

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-12 16:14:36 +01:00
parent 7c76fff135
commit d54a46f62f
2 changed files with 5 additions and 9 deletions

View File

@ -784,7 +784,8 @@ public class CallActivity extends AppCompatActivity {
try {
receivedSignalingMessage(signalingOverall.getOcs().getSignalings().get(i));
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "Filed to process received signaling " +
"message");
}
}
}
@ -792,7 +793,6 @@ public class CallActivity extends AppCompatActivity {
@Override
public void onError(Throwable e) {
Log.d("MARIO_DEBUG", e.getLocalizedMessage());
dispose(signalingDisposable);
}
@ -939,7 +939,7 @@ public class CallActivity extends AppCompatActivity {
private void deleteMagicPeerConnection(MagicPeerConnectionWrapper magicPeerConnectionWrapper) {
magicPeerConnectionWrapper.removePeerConnection(magicPeerConnectionWrapperList.size() == 1);
magicPeerConnectionWrapper.removePeerConnection();
magicPeerConnectionWrapperList.remove(magicPeerConnectionWrapper);
}

View File

@ -92,13 +92,9 @@ public class MagicPeerConnectionWrapper {
}
}
public void removePeerConnection(boolean isFinal) {
if (peerConnection != null && localMediaStream != null) {
public void removePeerConnection() {
if (peerConnection != null) {
peerConnection.close();
peerConnection.removeStream(localMediaStream);
if (isFinal) {
peerConnection.dispose();
}
peerConnection = null;
}
}