From f93bac6d73a72a7047425b4cb87fd3a774d0ceb1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 28 Apr 2020 20:15:23 +0200 Subject: [PATCH] catch ISE around peerconnection.dispose() --- .../siacs/conversations/xmpp/jingle/WebRTCWrapper.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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