Commit 3c57a6c7 authored by Tor Lillqvist's avatar Tor Lillqvist

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.
parent 0d6b1ab4
......@@ -1137,7 +1137,8 @@ g_io_win32_free (GIOChannel *channel)
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 (win32_channel->debug)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment