Don't call WSAEventSelect() on -1

If g_io_win32_sock_close() has been called on a socket channel, don't
later in g_io_win32_free() call WSAEventSelect() on its fd which has
been set to -1.
This commit is contained in:
Tor Lillqvist 2009-11-04 23:59:18 +02:00
parent 0d6b1ab42a
commit 3c57a6c7cc

View File

@ -1137,7 +1137,8 @@ g_io_win32_free (GIOChannel *channel)
g_free (emsg); g_free (emsg);
} }
if (win32_channel->type == G_IO_WIN32_SOCKET) if (win32_channel->type == G_IO_WIN32_SOCKET &&
win32_channel->fd != -1)
if (WSAEventSelect (win32_channel->fd, NULL, 0) == SOCKET_ERROR) if (WSAEventSelect (win32_channel->fd, NULL, 0) == SOCKET_ERROR)
if (win32_channel->debug) if (win32_channel->debug)
{ {