- WSAEventSelect (win32_channel->fd, NULL, 0);
- DeleteCriticalSection (&win32_channel->mutex);
+ if (WSAEventSelect (win32_channel->fd, NULL, 0) == SOCKET_ERROR)
+ if (win32_channel->debug)
+ {
+ gchar *emsg = g_win32_error_message (WSAGetLastError ());
+
+ g_print (" WSAEventSelect(%d,NULL,{}) failed: %s\n",
+ win32_channel->fd, emsg);
+ g_free (emsg);
+ }
+
+ if (win32_channel->event)
+ if (!WSACloseEvent (win32_channel->event))
+ if (win32_channel->debug)
+ {
+ gchar *emsg = g_win32_error_message (WSAGetLastError ());
+
+ g_print (" WSACloseEvent(%p) failed: %s\n",
+ win32_channel->event, emsg);
+ g_free (emsg);
+ }