Skip to content
Snippets Groups Projects
Commit a4724c42 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix memory leaks

parent 20d7b4ca
Branches
Tags
No related merge requests found
...@@ -420,6 +420,7 @@ int GModel::_readMSH2(const std::string &name) ...@@ -420,6 +420,7 @@ int GModel::_readMSH2(const std::string &name)
} }
else{ else{
if(!getVertices(numVertices, indices, vertexMap, vertices)){ if(!getVertices(numVertices, indices, vertexMap, vertices)){
delete [] indices;
fclose(fp); fclose(fp);
return 0; return 0;
} }
......
...@@ -1006,8 +1006,10 @@ bool Centerline::cutByDisk(SVector3 &PT, SVector3 &NORM, double &maxRad) ...@@ -1006,8 +1006,10 @@ bool Centerline::cutByDisk(SVector3 &PT, SVector3 &NORM, double &maxRad)
double rdist = -V1/(V2-V1); double rdist = -V1/(V2-V1);
if (inters && rdist > EPS && rdist < 1.-EPS){ if (inters && rdist > EPS && rdist < 1.-EPS){
SVector3 PZ = P1+rdist*(P2-P1); SVector3 PZ = P1+rdist*(P2-P1);
if (inDisk){
MVertex *newv = new MVertex (PZ.x(), PZ.y(), PZ.z()); MVertex *newv = new MVertex (PZ.x(), PZ.y(), PZ.z());
if (inDisk) cutEdges.insert(std::make_pair(me,newv)); cutEdges.insert(std::make_pair(me,newv));
}
} }
else if (inters && rdist <= EPS && inDisk ) else if (inters && rdist <= EPS && inDisk )
cutVertices.push_back(me.getVertex(0)); cutVertices.push_back(me.getVertex(0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment