Skip to content

Commit cd4a521

Browse files
committed
Fix race condition in socket close
1 parent fc71bad commit cd4a521

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Socket.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ int Socket::close()
5353
return 0;
5454
}
5555

56-
void *socket = _socket;
56+
_iface->socket_attach(_socket, 0, 0);
57+
58+
void *volatile socket = _socket;
5759
_socket = 0;
5860
return _iface->socket_close(socket);
5961
}

0 commit comments

Comments
 (0)