[vtkusers] Unhandled exception at the time of Unregistering vtkSmartPointer

cel02000 cel02000 at yahoo.com
Fri Jun 8 22:10:01 EDT 2012


David,

Please find an example below.

int main()
{
    vtkPolyData * polyData50 = vtkPolyData::New(); /// Previously, I used
vtkSmartPointer< vtkPolyData > polyData50; I even did not used New()
function but with using pointer I have to use it./
    Read50Files( polyData50 , "c:\\acquisitions_directory" ); /// After this
line polyData50 does not contain any pointdata./
    return 0;
}

int Read50Files( vtkPolyData * polyData50 , char * ) // Previously, I had
/int Read50Files( vtkSmartPointer< vtkPolyData> & polyData50, char * )/
{
    /// reading and appending the data in 50 files./
    for( int i=0; i<50; i++)    
    {
        /// polyDataFile is a vtkPolyData dataset which is read from the
reader./
        appendFilter->AddInput( polyDataFile );
    }
    appendFilter->Update();	

    polyData50 = appendFilter->GetOutput(); /// After this line, polyOut has
the correct number of pointdata, read from 50 files./
    
    return 0;
}

The reason I am using pointers instead of vtkSmartPointer in function
arguments is to follow your recommendation. So I changed all my code's
functions to use pointer instead of vtkSmartPointer because I had a problem
in one of the functions in my code which gave me unhandled exception. 

Now with this change in all my functions (about 40 functions), they do not
work fine. The above example code, is the function which used to work fine
with vtkSmartPointer in the function argument list. I would be grateful for
your help on this problem.

Thanks,
Ahmad

--
View this message in context: http://vtk.1045678.n5.nabble.com/Unhandled-exception-at-the-time-of-Unregistering-vtkSmartPointer-tp5713691p5713701.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list