[vtkusers] Deleting unknown object: vtkObject - vector of pointers?
David Doria
daviddoria+vtk at gmail.com
Fri Nov 6 12:10:32 EST 2009
On Fri, Nov 6, 2009 at 11:38 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
> Your member variable does not have to be a smartpointer. If it is not,
> you'll have to Register it on a Set. And UnRegister on destruction.
> If you use the vtkSetObject macro, it will do the proper
> register/unregister. You will still have to UnRegister in the the
> descturcotr if it is not null.
>
Sorry to be such a pain about this...
If the member variable IS a smart pointer, then does it do the
register/unregister automatically? Is it recommended to have member
variables as smart pointers or not? If you DO make the member variable a
smart pointer, you must break the "don't include any headers but your
superclass" rule. Is that allowed in this case?
I switched to
vtkSetObjectMacro(Ray, vtkRay);
in an attempt to have it do the register/unregister automatically, but it
simply segfaults when I call SetRay.
The updated and simplified files are here:
http://www.rpi.edu/~doriad/VTK_List/DeletingUnknownObject/<http://www.rpi.edu/%7Edoriad/VTK_List/DeletingUnknownObject/>
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091106/bf6adb3d/attachment.htm>
More information about the vtkusers
mailing list