* select.cc (pipe_cleanup): Make sure that device_specific_pipe is always

deleted regardless of whether it has a unique thread associated with it.
This commit is contained in:
Christopher Faylor 2011-04-20 01:10:54 +00:00
parent 46ac7c5a4f
commit 693581e4a4
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2011-04-19 Peter Rosin <peda@lysator.liu.se>
* 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 <jon.turney@dronecode.org.uk>
* thread.cc (semaphore::init): We cannot reliably infer anything from

View file

@ -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