[TD] - Fix geometry object leaking on every exec

This commit is contained in:
vosk
2021-01-28 21:03:23 +02:00
committed by wmayer
parent 21e5fb66c4
commit 100a7ade4c

View File

@@ -298,11 +298,6 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
double newScale = autoScale();
Scale.setValue(newScale);
Scale.purgeTouched();
if (geometryObject != nullptr) {
delete geometryObject;
geometryObject = nullptr;
// partExec(shape);
}
partExec(shape);
}
}
@@ -348,6 +343,8 @@ void DrawViewPart::onChanged(const App::Property* prop)
void DrawViewPart::partExec(TopoDS_Shape shape)
{
// Base::Console().Message("DVP::partExec()\n");
if (geometryObject)
delete geometryObject;
geometryObject = makeGeometryForShape(shape);
if (geometryObject == nullptr) {
return;