From 39d921007e119cd18a5d0a1835ecda94aa67efe0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 21 Aug 2004 21:29:35 +0000 Subject: [PATCH] Tell select_thread to break out of its loop. Prevents a thread leak. 2004-08-21 Tor Lillqvist * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to break out of its loop. Prevents a thread leak. (#147392, Peter Zelezny) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-12 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ glib/giowin32.c | 5 +++++ 6 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index bd25605a..77d73c46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-08-21 Tor Lillqvist + * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to + break out of its loop. Prevents a thread leak. (#147392, Peter + Zelezny) + * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus return value from strxfrm(). For instance Microsoft's strxfrm() returns INT_MAX on errors. (#141124) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bd25605a..77d73c46 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2004-08-21 Tor Lillqvist + * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to + break out of its loop. Prevents a thread leak. (#147392, Peter + Zelezny) + * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus return value from strxfrm(). For instance Microsoft's strxfrm() returns INT_MAX on errors. (#141124) diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index bd25605a..77d73c46 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,5 +1,9 @@ 2004-08-21 Tor Lillqvist + * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to + break out of its loop. Prevents a thread leak. (#147392, Peter + Zelezny) + * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus return value from strxfrm(). For instance Microsoft's strxfrm() returns INT_MAX on errors. (#141124) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index bd25605a..77d73c46 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,9 @@ 2004-08-21 Tor Lillqvist + * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to + break out of its loop. Prevents a thread leak. (#147392, Peter + Zelezny) + * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus return value from strxfrm(). For instance Microsoft's strxfrm() returns INT_MAX on errors. (#141124) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index bd25605a..77d73c46 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2004-08-21 Tor Lillqvist + * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to + break out of its loop. Prevents a thread leak. (#147392, Peter + Zelezny) + * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus return value from strxfrm(). For instance Microsoft's strxfrm() returns INT_MAX on errors. (#141124) diff --git a/glib/giowin32.c b/glib/giowin32.c index ea05f9c4..8d435538 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -728,7 +728,12 @@ g_io_win32_finalize (GSource *source) SetEvent (channel->data_avail_noticed_event); if (channel->type == G_IO_WIN32_SOCKET) + { + /* Tell select_thread() to exit */ + channel->needs_close = 1; + /* Wake up select_thread() from its blocking select() */ send (channel->reset_send, send_buffer, sizeof (send_buffer), 0); + } g_io_channel_unref (watch->channel); UNLOCK (channel->mutex); -- 2.34.1