QtVtk icon indicating copy to clipboard operation
QtVtk copied to clipboard

ProcessingEngine::getModelFromActor is throwing read access violation

Open fazila-rahman opened this issue 4 years ago • 1 comments

Hi, I have managed to compile the run the code on Windows 10 (64bit) with VTK8.2 and Qt5.12.6 using the msvc2017_64 compiler. It is now loading the model fine, thanks to contributors!

The only problem I am facing is: when trying to click on the 3D model (e.g. the big hand image) it is throwing read access violation from the PocessingEngine::getModelFromActor method. As I have traced the origin of this exception I find that the shared_pointer stored inside the m_models vector is invalid (or may be out of scope) and hence the vector exception is occurring. Here is the highlighted code that is throwing this exception: for (const std::shared_ptr<Model>& model : m_models) { qDebug() << "ProcessingEngine::getModelFromActor: Bingo1"; if (model->getModelActor() == modelActor) { qDebug() << "ProcessingEngine::getModelFromActor: Bingo2"; return model; } qDebug() << "ProcessingEngine::getModelFromActor: Bingo3"; }
I am a newbie at this VTK world; please help!

Thanks for your support!

fazila-rahman avatar Jan 05 '20 19:01 fazila-rahman

I have seen also several times, crashing due to probably the share pointer is getting out of scope, it is hard to track it though, any update on this aspect ? do you think worth to try vtkSmartPointer instead or something else?

kshahim avatar Mar 11 '20 20:03 kshahim