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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user