summaryrefslogtreecommitdiff
path: root/platform/windows/packet_peer_udp_winsock.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-18 10:48:50 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-23 20:15:20 +0100
commite4b9b37ccf8495be674bc15cf0bf9d76fe94e6be (patch)
tree583f1f5f7db8528410e125cb956eb87b730f6cff /platform/windows/packet_peer_udp_winsock.cpp
parent8e84e53ebb676e43adc7ac4b3e8791790f555695 (diff)
Avoid calling close when polling a UDP peer without socket
Diffstat (limited to 'platform/windows/packet_peer_udp_winsock.cpp')
-rw-r--r--platform/windows/packet_peer_udp_winsock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp
index 5baa01c289..e091df6d00 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -152,6 +152,9 @@ Error PacketPeerUDPWinsock::wait() {
}
Error PacketPeerUDPWinsock::_poll(bool p_wait) {
+ if (sockfd==-1) {
+ return FAILED;
+ }
_set_blocking(p_wait);