// We will store the main loop's reference when Initialize is called
static CFRunLoopRef s_mainRunLoop = NULL;
-void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType,
- CFDataRef address, const void* data, void* info)
+void Mac_Socket_Callback(CFSocketRef WXUNUSED(s), CFSocketCallBackType callbackType,
+ CFDataRef WXUNUSED(address), const void* data, void* info)
{
GSocket* socket = (GSocket*)info;
struct MacGSocketData* macdata;
/* CFSocketInvalidate does CFRunLoopRemoveSource anyway */
CFRunLoopRemoveSource(s_mainRunLoop, data->source, kCFRunLoopCommonModes);
CFSocketInvalidate(data->socket);
+
+ // CFSocketInvalidate has closed the socket so we want to make sure GSocket knows this
+ socket->m_fd = -1 /*INVALID_SOCKET*/;
}
#endif // wxUSE_SOCKETS