[glib] Don't call WSAEventSelect() on -1
- From: Tor Lillqvist <tml src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib] Don't call WSAEventSelect() on -1
- Date: Wed, 4 Nov 2009 22:04:57 +0000 (UTC)
commit 3c57a6c7ccb38efb8fb3ecf12e9f66f113ffde19
Author: Tor Lillqvist <tml iki fi>
Date: Wed Nov 4 23:59:18 2009 +0200
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.
glib/giowin32.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/glib/giowin32.c b/glib/giowin32.c
index d638544..d661865 100644
--- a/glib/giowin32.c
+++ b/glib/giowin32.c
@@ -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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]