<div class="gmail_quote">On Fri, Nov 6, 2009 at 12:26 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></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;">
Ray is not initialized in the constructor. Do a<br>
Ray=NULL;<br>
<br>
Don't forget to Delete() Ray in the destructor.<br>
<div><div></div><div></div></div></blockquote><div><br>Getting closer... it gets to the end of the program now without crashing, errors, or warnings - but when the program quits (I put a break point on the 'return 0' statement and the following errors happen when I step over return 0) I get "Deleting unknown object" errors. I'm assuming I am misinterpreting the reference count that happens when the objects get added to the stl container and when the container goes out of scope? Should the stl vector(s) be of smartpointers or standard pointers?<br>
<br>I added the following line at the end of the outer loop:<br><br> vtkstd::cout << "Ref after column added to grid: " << Grid[0][0]->GetReferenceCount() << vtkstd::endl;<br><br>The reference count is still 2... is this what we would expect? Shouldn't it be 3 here? Because then when the program terminates, the outer vector (1) deletes the inner vectors(2) which delete the LidarPoints (3) so the count should have been 3 to then go down to 0?<br>
<br>Here is the current version: <a href="http://rpi.edu/~doriad/VTK_List/DeletingUnknownObject/">http://rpi.edu/~doriad/VTK_List/DeletingUnknownObject/</a> (there are too many files to post the code directly to the list).<br>
<br>One day we'll get this resolved... haha.<br><br clear="all">Thanks,<br><br>David<br></div></div>