* Revert Darwin specific changes to GSocket_destroy.
* In GSocket_Shutdown do not call close on Darwin since gsockosx.c will do it during CFInvalidate which will be called from GSocket_Disable_Events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -261,7 +261,10 @@ GSocket *GSocket_new(void)
|
|||||||
void GSocket_close(GSocket *socket)
|
void GSocket_close(GSocket *socket)
|
||||||
{
|
{
|
||||||
_GSocket_Disable_Events(socket);
|
_GSocket_Disable_Events(socket);
|
||||||
|
// gsockosx.c calls CFSocketInvalidate which closes the socket for us
|
||||||
|
#if !(defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)))
|
||||||
close(socket->m_fd);
|
close(socket->m_fd);
|
||||||
|
#endif
|
||||||
socket->m_fd = INVALID_SOCKET;
|
socket->m_fd = INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,20 +272,12 @@ void GSocket_destroy(GSocket *socket)
|
|||||||
{
|
{
|
||||||
assert(socket != NULL);
|
assert(socket != NULL);
|
||||||
|
|
||||||
/* When using CFSocket we MUST invalidate before closing the fd */
|
|
||||||
#ifdef __DARWIN__
|
|
||||||
/* Per-socket GUI-specific cleanup */
|
|
||||||
_GSocket_GUI_Destroy_Socket(socket);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Check that the socket is really shutdowned */
|
/* Check that the socket is really shutdowned */
|
||||||
if (socket->m_fd != INVALID_SOCKET)
|
if (socket->m_fd != INVALID_SOCKET)
|
||||||
GSocket_Shutdown(socket);
|
GSocket_Shutdown(socket);
|
||||||
|
|
||||||
#ifndef __DARWIN__
|
|
||||||
/* Per-socket GUI-specific cleanup */
|
/* Per-socket GUI-specific cleanup */
|
||||||
_GSocket_GUI_Destroy_Socket(socket);
|
_GSocket_GUI_Destroy_Socket(socket);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Destroy private addresses */
|
/* Destroy private addresses */
|
||||||
if (socket->m_local)
|
if (socket->m_local)
|
||||||
|
Reference in New Issue
Block a user