catch ISE around peerconnection.dispose()

This commit is contained in:
Daniel Gultsch 2020-04-28 20:15:23 +02:00
parent faf1ff365d
commit f93bac6d73

View file

@ -230,7 +230,7 @@ public class WebRTCWrapper {
final AppRTCAudioManager audioManager = this.appRTCAudioManager; final AppRTCAudioManager audioManager = this.appRTCAudioManager;
final EglBase eglBase = this.eglBase; final EglBase eglBase = this.eglBase;
if (peerConnection != null) { if (peerConnection != null) {
peerConnection.dispose(); dispose(peerConnection);
this.peerConnection = null; this.peerConnection = null;
} }
if (audioManager != null) { if (audioManager != null) {
@ -251,6 +251,14 @@ public class WebRTCWrapper {
} }
} }
private static void dispose(final PeerConnection peerConnection) {
try {
peerConnection.dispose();
} catch (final IllegalStateException e) {
Log.e(Config.LOGTAG,"unable to dispose of peer connection", e);
}
}
void verifyClosed() { void verifyClosed() {
if (this.peerConnection != null if (this.peerConnection != null
|| this.eglBase != null || this.eglBase != null