
15 May
2003
15 May
'03
11:57 a.m.
ostware wrote:
~T needs to tell another object it holds a pointer to (say class U) that it is 'going away' during its destructor. T and U are loosely connected, from two different libraries, and each holds a weak_ptr to the other. When U finds out that T is 'going away' it needs to void out its weak_ptr<T>. I am converting code where the weak_ptrs were simple U* or T*.
You don't need to do anything. A weak_ptr is "voided" automagically when its object (managed by a shared_ptr) goes away. ;-)