PVS: V773 The exception was thrown without releasing the pointer. A memory leak is possible.

This commit is contained in:
wmayer
2020-07-17 00:03:01 +02:00
parent ab8f06d9ab
commit f29a1c43cb

View File

@@ -55,13 +55,13 @@ BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, c
return new BRepAlgoAPI_Section(base, tool);
#else
bool approx = Approximation.getValue();
BRepAlgoAPI_Section* mkSection = new BRepAlgoAPI_Section();
std::unique_ptr<BRepAlgoAPI_Section> mkSection(new BRepAlgoAPI_Section());
mkSection->Init1(base);
mkSection->Init2(tool);
mkSection->Approximation(approx);
mkSection->Build();
if (!mkSection->IsDone())
throw Base::RuntimeError("Section failed");
return mkSection;
return mkSection.release();
#endif
}