diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index a5fc8429a..ffbd8cf70 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -230,7 +230,7 @@ public class WebRTCWrapper { final AppRTCAudioManager audioManager = this.appRTCAudioManager; final EglBase eglBase = this.eglBase; if (peerConnection != null) { - peerConnection.dispose(); + dispose(peerConnection); this.peerConnection = 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() { if (this.peerConnection != null || this.eglBase != null