[vtkusers] Call for Examples!

Bryn Lloyd blloyd at vision.ee.ethz.ch
Tue Jan 5 03:13:56 EST 2010


Kenneth,

Regarding example:
http://www.cmake.org/Wiki/Create_a_surface_from_Unorganized_Points

The reason for the segmentation fault is that the vtkPoints is created 
in the function and returned. The smartpointer reduced its count to zero 
and deletes it.

I fixed the example. Now it first creates the vtkPoints. The actual 
values are inserted in the readPoints function.

Cheers
Bryn



Kenneth Porter wrote:
> --On Monday, January 04, 2010 8:52 AM -0500 David Doria 
> <daviddoria+vtk at gmail.com> wrote:
> 
>> http://www.cmake.org/Wiki/VTK/Examples#Broken.2FMissing_Examples_.28Pleas
>> e_write.2Ffix_me.21.29
> 
> I took a look at this example and it looks like it's returning a pointer 
> to a deleted object:
> 
> <http://www.cmake.org/Wiki/Create_a_surface_from_Unorganized_Points>
> 
> The smart pointer goes out of scope in readPoints() and deletes the 
> object before main() can use it.
> 
> However, I'm new to VTK and its garbage collector, so perhaps I'm 
> misinterpreting the code. Can someone confirm my analysis?
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 


-- 
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7, ETF C110
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------



More information about the vtkusers mailing list