[vtkusers] Unhandled exception at the time of Unregistering vtkSmartPointer
David Doria
daviddoria at gmail.com
Mon Jun 11 20:55:02 EDT 2012
On Mon, Jun 11, 2012 at 8:22 PM, cel02000 <cel02000 at yahoo.com> wrote:
> I used the following.
>
> vtkPolyData * singlePolyData = vtkPolyData::New();
> vector< vtkPolyData * > vectorOfPolyData;
>
> Then I store the content of a file by vtkTecplotReader to singlePolyData
> and
> then:
> vectorOfPolyData.push_back( singlePolyData );
>
> Actually I don't initialize the vector. However, when I try to initialize
> the vector with the following, I get Debug Assertion Fail.
> vectorOfPolyData[0] = vtkPolyData::New().
>
> Ahmad
>
As always, short, compilable example code goes a long way!
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
#include <vector>
int main()
{
vtkPolyData * singlePolyData = vtkPolyData::New();
std::vector< vtkPolyData * > vectorOfPolyData;
vectorOfPolyData.push_back( singlePolyData );
vectorOfPolyData[0]->Delete();
return 0;
}
That compiles and runs fine, and DebugLeaks is quiet for me. Please create
a similarly long and fully compilable example of your problem if you are
still having one.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120611/b34a76d0/attachment.htm>
More information about the vtkusers
mailing list