Coverity: Resource leak
This commit is contained in:
@@ -591,9 +591,9 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document
|
||||
}
|
||||
|
||||
App::DocumentObject* mesh = pcDoc->addObject("Fem::FemMeshObject", "ResultMesh");
|
||||
FemMesh* fmesh = new FemMesh(); // PropertyFemMesh instance is responsible to release FemMesh ??
|
||||
importVTKMesh(dataset, fmesh);
|
||||
static_cast<PropertyFemMesh*>(mesh->getPropertyByName("FemMesh"))->setValue(*fmesh);
|
||||
std::unique_ptr<FemMesh> fmesh(new FemMesh());
|
||||
importVTKMesh(dataset, fmesh.get());
|
||||
static_cast<PropertyFemMesh*>(mesh->getPropertyByName("FemMesh"))->setValuePtr(fmesh.release());
|
||||
static_cast<App::PropertyLink*>(result->getPropertyByName("Mesh"))->setValue(mesh);
|
||||
// PropertyLink is the property type to store DocumentObject pointer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user