Boost logo

Boost Users :

From: Manuel Jung (gzahl_at_[hidden])
Date: 2007-01-12 06:26:53


Robert Marion wrote:

> Manuel Jung wrote:
>>> Hi,
>>>
>>> I have a strange problem. The destructor of a class
> calls
> join_all().
>>> But it seems that he hangs there. Even though some
> other code behind
> the
>>> join_all() is executed before it finishs!
>>> Lets get concret:
>>>
>>> seal::~seal()
>>> {
>>> ThgPrgs.join_all();
>>> cout<<"Crabd quits, goodbye"<<endl;
>>> }
>>
>> Could you possibly post a small (complete) example
> that demonstrates
> the
>> behaviour? I am not able to guess where to problem
> might be from
> looking
>> at the destructor only.
>
> Are you expecting the destructor to be called once?
> Probably what is happening is your default constructor
> is being called more than once (during a copy
> operation) and you are unaware of it. So your
> destructor gets called more than once.
> Robert Marion

Hi,
Thank you very much! This was indeed the problem. There was copy of the
object handed over too an other object with a "this" pointer so i didnt see
it and was than initializing a shared_ptr. Now it is handeld correctly a my
program is shutting down in the right way.
Again thank everyone for your helping hand!

Greetings
Manuel Jung


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