diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-01-03 19:50:48 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-01-03 19:50:48 +0100 |
commit | bd8e139ccc04590d11b2347e3987a38d6f732c27 (patch) | |
tree | 7b3c37eb504317d2bc5401604621a84a03b3eaaf | |
parent | 6983019cab6acc39d3e4157f7e03aafadb2291df (diff) | |
download | fork-godot-webrtc-native-bd8e139ccc04590d11b2347e3987a38d6f732c27.tar.gz fork-godot-webrtc-native-bd8e139ccc04590d11b2347e3987a38d6f732c27.tar.bz2 fork-godot-webrtc-native-bd8e139ccc04590d11b2347e3987a38d6f732c27.zip |
Fix crash when closing an invalid peerconnection.
-rw-r--r-- | src/WebRTCLibPeerConnection.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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(); } |