[Part] - Fix View3DInventor.setCamera leaking SoCamera*
This commit is contained in:
@@ -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<SoNode> camPtr(Cam, true);
|
||||
|
||||
// toggle between perspective and orthographic camera
|
||||
if (Cam->getTypeId() != CamViewer->getTypeId())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user