TD: [skip ci] explicitly nullify geometryObject in DrawViewPart::partExec to avoid to leave it a dangling pointer in case makeGeometryForShape raises an exception

This commit is contained in:
wmayer
2021-02-25 11:34:29 +01:00
parent 755f4cf1be
commit 2de6a80bb4

View File

@@ -343,8 +343,10 @@ void DrawViewPart::onChanged(const App::Property* prop)
void DrawViewPart::partExec(TopoDS_Shape shape)
{
// Base::Console().Message("DVP::partExec()\n");
if (geometryObject)
if (geometryObject) {
delete geometryObject;
geometryObject = nullptr;
}
geometryObject = makeGeometryForShape(shape);
if (geometryObject == nullptr) {
return;