off kCFSocketCloseOnInvalidate. Furthermore,
kCFSocketAutomaticallyReenableWriteCallback wasn't part of default flags
but had been erroneously included here.
* Call CFSocketInvalidate() from _GSocket_Diable_Events instead of from
_GSocket_GUI_Destroy_Socket. GSocket calls this from GSocket_close
and so in combination with the above change and the most recent change
to gsocket.c the CFSocket should now be invalidated and closed for all
cases and not just planned shutdown.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25168
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
- /* Turn off kCFSocketCloseOnInvalidate (NOTE: > 10.2 only!) */
- /* Another default flag that we don't turn on here is for DataCallBack and
- also AcceptCallback (which overlap in bits) which we don't use anyway */
- /* FIXME: For < 10.2 compatibility fix GSocket to call a platform-dependent
- function to close the socket so that we can just call invalidate and
- avoid having to set any special flags at all. */
- CFSocketSetSocketFlags(cf, kCFSocketAutomaticallyReenableReadCallBack | kCFSocketAutomaticallyReenableWriteCallBack);
socket->m_gui_dependent = (char*)data;
/* Keep the source and the socket around. */
socket->m_gui_dependent = (char*)data;
/* Keep the source and the socket around. */
struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent);
if (data)
{
struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent);
if (data)
{
- CFSocketInvalidate(data->socket);
CFRelease(data->socket);
free(data);
}
CFRelease(data->socket);
free(data);
}
struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket);
if (!data) return;
struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket);
if (!data) return;
+ /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes);
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes);
+ CFSocketInvalidate(data->socket);
}
#endif // wxUSE_SOCKETS
}
#endif // wxUSE_SOCKETS
ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
ALL_CALLBACK_TYPES, Mac_Socket_Callback, &cont);
CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, cf, 0);
assert(source);
- /* Turn off kCFSocketCloseOnInvalidate (NOTE: > 10.2 only!) */
- /* Another default flag that we don't turn on here is for DataCallBack and
- also AcceptCallback (which overlap in bits) which we don't use anyway */
- /* FIXME: For < 10.2 compatibility fix GSocket to call a platform-dependent
- function to close the socket so that we can just call invalidate and
- avoid having to set any special flags at all. */
- CFSocketSetSocketFlags(cf, kCFSocketAutomaticallyReenableReadCallBack | kCFSocketAutomaticallyReenableWriteCallBack);
socket->m_gui_dependent = (char*)data;
/* Keep the source and the socket around. */
socket->m_gui_dependent = (char*)data;
/* Keep the source and the socket around. */
struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent);
if (data)
{
struct MacGSocketData *data = (struct MacGSocketData*)(socket->m_gui_dependent);
if (data)
{
- CFSocketInvalidate(data->socket);
CFRelease(data->socket);
free(data);
}
CFRelease(data->socket);
free(data);
}
struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket);
if (!data) return;
struct MacGSocketData* data = _GSocket_Get_Mac_Socket(socket);
if (!data) return;
+ /* CFSocketInvalidate does CFRunLoopRemoveSource anyway */
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes);
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), data->source, kCFRunLoopCommonModes);
+ CFSocketInvalidate(data->socket);
}
#endif // wxUSE_SOCKETS
}
#endif // wxUSE_SOCKETS