12 May
2009
12 May
'09
4:17 p.m.
Hello, Is there any trick or customization that would allow the subj? I mean the following situation: // pseudo-code! class intrusively_refcounted : //... { private: void listenToAsyncSubsystem() { // signals will come from another thread asyncSubsystem_.someEvent.connect(slot_type(&intrusively_refcounted::handler, this).track(???)); // can't use here shared_ptr/weak_ptr for tracking } }; I could store a connection object, so that it would be destroyed/disconnected in ~intrusively_refcounted(), but I guess it's not thread-safe, just like the approach with "trackable". So what would be the correct approach? Thanks!