From 693581e4a48b3f18c4cf648b809d4e21a0ae1b84 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 20 Apr 2011 01:10:54 +0000 Subject: [PATCH] * select.cc (pipe_cleanup): Make sure that device_specific_pipe is always deleted regardless of whether it has a unique thread associated with it. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/select.cc | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fe817b4c9..b2a088cac 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-04-19 Peter Rosin + + * select.cc (pipe_cleanup): Make sure that device_specific_pipe is + always deleted regardless of whether it has a unique thread associated + with it. + 2011-04-02 Jon TURNEY * thread.cc (semaphore::init): We cannot reliably infer anything from diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 4389b8e66..e63567700 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -644,13 +644,15 @@ static void pipe_cleanup (select_record *, select_stuff *stuff) { select_pipe_info *pi = (select_pipe_info *) stuff->device_specific_pipe; - if (pi && pi->thread) + if (!pi) + return; + if (pi->thread) { pi->stop_thread = true; pi->thread->detach (); - delete pi; - stuff->device_specific_pipe = NULL; } + delete pi; + stuff->device_specific_pipe = NULL; } int