diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 396da77057..ee55f39111 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -774,10 +774,13 @@ bool View3DInventor::setCamera(const char* pCamera) SoNode * Cam; SoDB::read(&in,Cam); - if (!Cam){ + if (!Cam || !Cam->isOfType(SoCamera::getClassTypeId())) { throw Base::RuntimeError("Camera settings failed to read"); } + // this is to make sure to reliably delete the node + CoinPtr camPtr(Cam, true); + // toggle between perspective and orthographic camera if (Cam->getTypeId() != CamViewer->getTypeId()) {