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