|
Boost Users : |
Subject: Re: [Boost-users] boost::asio destructor segfault?
From: Sean McAllister (smcallis_at_[hidden])
Date: 2010-03-19 11:39:09
On Fri, Mar 19, 2010 at 8:36 AM, Rutger ter Borg <rutger_at_[hidden]> wrote:
> Sean McAllister wrote:
> >
> > Hmmm, I've only got the one extra thread to run the asynchronous event
> > loop
> > in. If I have
> > async_read events outstanding, wouldn't the above code cause my
> destructor
> > to block
> > until I've read another message (which may happen quite infrequently)?
> >
>
> That's right -- but you still would like to have all operations finished
> before the end of the destructor. If you need to close sockets, call, e.g.,
> socket::close.
>
> Cheers,
>
> Rutger
>
> Oh duh, I should be calling stop on my io_service object and then joining
the thread that
has the event loop waiting for it to exit. Doing that seems to have solved
the problem.
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net