summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/WebRTCLibPeerConnection.cpp5
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();
}