[Insight-users] Why is itkDataObject::m_Source a WeakPointer?

Th. Boettger t.boettger@dkfz-heidelberg.de
Fri, 11 Oct 2002 18:24:30 +0200


Hi all,

I am trying to construct a filter pipeline in a member function and to
return the resulting data object *without* calling Update() in this method.
When trying to update the returned data object outside, the source is set to
NULL. The reason is that m_Source member is defined as a weak pointer, thus
the reference count of the process objects (the source) is not incremented.

Why is it a WeakPointer? How can I avoid this problem?

class itkDataObject
{
...
mutable WeakPointer<ProcessObject> m_Source;
...
}

Thanks in advance!



---
Dipl.-Inform. Thomas Boettger
Deutsches Krebsforschungszentrum         (German Cancer Research Center)
Div. Medical and Biological Informatics H0100    Tel: (+49) 6221-42 2328
Im Neuenheimer Feld 280                          Fax: (+49) 6221-42 2345
D-69120 Heidelberg                            e-mail: t.boettger@dkfz.de
Germany                      http://www.dkfz.de/mbi/people/thomasb.shtml