Boost logo

Boost Users :

Subject: Re: [Boost-users] [ASIO] Access violation on io_service::work destructor
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-09-23 08:37:47


On 2010-09-23 12:00, Daniele Barzotti wrote:
>
> Why ' thread_started = !thread_started; ' is a bad stuff?
>

 From what I could see (not knowing where the work object is
deallocated), the worker thread could have finished before this
statement is executed. The thing I referred to as being 'bad stuff' was
the allocation of a work object which is not being deallocated when the
thread didn't start properly.

[snip]
> pMyObject->_io_work_ptr.reset(p_work);
[/snip]

I guess all your pMyObjects have shared pointers with a reference count
of 1; you reset them all with a plain pointer (p_work).

Regards,

Rutger


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