<br><div class="gmail_quote">On Fri, Nov 6, 2009 at 10:27 AM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Does SetRay increment the reference count of the Ray? Using<br>
this-&gt;Ray-&gt;Register(this)<br>
<br>
I tried your example with two vtk objects and it worked as expected.<br>
<font color="#888888"><br>
Bill<br>
</font><div><div></div><div></div></div></blockquote><div><br>My member variable was not a smart pointer:<br>vtkRay* Ray;<br><br>Should it be?<br><br>My SetRay function was:<br>void vtkLidarPoint::SetRay(vtkRay* R)<br>
{<br>  this-&gt;Ray-&gt;DeepCopy(R);<br>}<br><br>I got rid of the deep copy and changed it to accept a smart pointer and to register the pointer to the ray with the LidarPoint object. However, I still get the &quot;Deleting unknown object&quot; errors.<br>
<br>Here is the smallest extracted version that demonstrates the problem:<br><a href="http://www.rpi.edu/~doriad/VTK_List/DeletingUnknownObject/">http://www.rpi.edu/~doriad/VTK_List/DeletingUnknownObject/</a><br><br>I actually think this is a very good example to demonstrate a lot of these smart pointer issues all in one shot. If you guys can help me try to get a handle on this I&#39;ll try to improve the smart pointer tutorial I started.<br>
<br clear="all">Thanks,<br><br>David<br></div></div>