
23 Sep
2010
23 Sep
'10
12:37 p.m.
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