6 Feb
2007
6 Feb
'07
3:23 p.m.
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