|
Boost Users : |
From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2007-02-06 10:23:43
On Feb 5, 2007, at 6:28 PM, Timmo Stange wrote:
> I understand your dilemma, but this can't be solved unless we
> decide to
> use something completely different from shared_ptr. The idea is that
> by connecting a slot to a signal, the lifetime tracking of bound
> objects is started and as soon as all shared_ptr references go out of
> scope, the slot is disconnected. Even if we could open up a loophole,
> you could never start tracking from the constructor itself, as the
> external shared_ptr reference to your object is only initialized when
> the constructor returns. You would need a second call to the member
> function to start tracking, in which case you can just as well set
> up the connection there.
Does enable_shared_from_this help at all?
Cheers,
Doug
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