From bd8e139ccc04590d11b2347e3987a38d6f732c27 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 3 Jan 2020 19:50:48 +0100 Subject: Fix crash when closing an invalid peerconnection. --- src/WebRTCLibPeerConnection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/WebRTCLibPeerConnection.cpp b/src/WebRTCLibPeerConnection.cpp index a922f1b..6e81a7c 100644 --- a/src/WebRTCLibPeerConnection.cpp +++ b/src/WebRTCLibPeerConnection.cpp @@ -172,7 +172,10 @@ godot_error WebRTCLibPeerConnection::poll() { } void WebRTCLibPeerConnection::close() { - peer_connection->Close(); + if (peer_connection.get() != nullptr) { + peer_connection->Close(); + } + peer_connection = nullptr; while(!signal_queue.empty()) { signal_queue.pop(); } -- cgit v1.2.3