X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ba6a836246ee6768c29d50adfe9fee30221da8e..4eccf53dd554235876dccd4e37331d64427e84c4:/src/mac/corefoundation/gsockosx.cpp diff --git a/src/mac/corefoundation/gsockosx.cpp b/src/mac/corefoundation/gsockosx.cpp index ac4da2300e..afbf551477 100644 --- a/src/mac/corefoundation/gsockosx.cpp +++ b/src/mac/corefoundation/gsockosx.cpp @@ -28,8 +28,8 @@ struct MacGSocketData // 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; @@ -206,6 +206,9 @@ void GSocketGUIFunctionsTableConcrete::Disable_Events(GSocket *socket) /* 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