From 2c7c44e957edb7df8ab63f628c4233073bfe374e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 1 Dec 2022 20:46:18 +0100 Subject: [PATCH] null PeerConnection reference before disposing; otherwise getState() might be issued against disposed object --- .../java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java | 3 ++- 1 file changed, 2 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 4bb26be72..b929e9509 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -445,8 +445,8 @@ public class WebRTCWrapper { final AppRTCAudioManager audioManager = this.appRTCAudioManager; final EglBase eglBase = this.eglBase; if (peerConnection != null) { - dispose(peerConnection); this.peerConnection = null; + dispose(peerConnection); } if (audioManager != null) { toneManager.setAppRtcAudioManagerHasControl(false); @@ -467,6 +467,7 @@ public class WebRTCWrapper { this.eglBase = null; } if (peerConnectionFactory != null) { + this.peerConnectionFactory = null; peerConnectionFactory.dispose(); } }