[vtkusers] VTK 6.2.0 Bug in vtkVRMLImporter, example crashes if there are more than one instance of vtkVRMLImporter

Shawn Waldon shawn.waldon at kitware.com
Thu Apr 16 16:15:38 EDT 2015


Sorry it took so long to get to this.  I fixed a similar bug in
vtkVRMLImporter a while back.  I can confirm that this is a bug and is
reproducible on my machine, but I'm not sure when I'll have time to look at
it in more detail.  Please file a bug on the VTK bug tracker[1].  If you
want to debug it yourself, I can tell you that the issue is in the
vtkVRMLImporter destructor where it deletes this->Parser->useList.  Look
into what the value of useList is and how/where it is being set.

HTH,
Shawn

[1]: http://www.vtk.org/Bug/my_view_page.php

On Tue, Apr 7, 2015 at 7:39 AM, Arnaud Gelas <arnaudgelas at gmail.com> wrote:

> Hi all,
>
> We have slightly modified the following wiki example:
>
> http://www.itk.org/Wiki/VTK/Examples/Cxx/IO/VRML
>
>
> As follows:
>
> #include <vtkRenderer.h>
>
> #include <vtkRenderWindow.h>#include <vtkRenderWindowInteractor.h>#include <vtkVRMLImporter.h>#include <vtkDataSet.h>#include <vtkPolyData.h>#include <vtkSmartPointer.h>
>  int main ( int argc, char *argv[]){
>   if(argc != 2)
>     {
>     std::cout << "Required arguments: Filename" << std::endl;
>     return EXIT_FAILURE;
>     }
>
>   std::string filename = argv[1];
>   std::cout << "Reading " << filename << std::endl;
>
>   vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
>   vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
>   renderWindow->AddRenderer(renderer);
>
>   vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
>   renderWindowInteractor->SetRenderWindow(renderWindow);
>
>   // VRML Import
>   vtkSmartPointer<vtkVRMLImporter> importer = vtkSmartPointer<vtkVRMLImporter>::New();
>   importer->SetFileName ( filename.c_str() );
>   importer->SetRenderWindow(renderWindow);
>   importer->Update();
>
>   renderWindow->Render();
>   renderWindowInteractor->Start();
>
>
>   vtkSmartPointer<vtkRenderer> renderer2 = vtkSmartPointer<vtkRenderer>::New();
>
>   vtkSmartPointer<vtkRenderWindow> renderWindow2 = vtkSmartPointer<vtkRenderWindow>::New();
>   renderWindow2->AddRenderer(renderer2);
>
>   vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor2 = vtkSmartPointer<vtkRenderWindowInteractor>::New();
>   renderWindowInteractor2->SetRenderWindow(renderWindow2);
>
>   // VRML Import
>   vtkSmartPointer<vtkVRMLImporter> importer2 = vtkSmartPointer<vtkVRMLImporter>::New();
>   importer2->SetFileName ( filename.c_str() );
>   importer2->SetRenderWindow(renderWindow2);
>   importer2->Update();
>
>   renderWindow2->Render();
>   renderWindowInteractor2->Start();
>
>
>   return EXIT_SUCCESS; }
>
>
>
>
>
> As you can see the modification is quite simple, we have just created 2
> instances of every objects…
>
> This naive example crashes when exiting (trying to delete the second
> importer, i.e. importer2).
>
> Any idea what could go wrong? and how to fix this bug?
>
> Thanks in advance,
> Best regards
>
> Arnaud
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150416/41570976/attachment.html>


More information about the vtkusers mailing list