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

fix memory leaks

parent 20d7b4ca
No related branches found
No related tags found
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);
MVertex *newv = new MVertex (PZ.x(), PZ.y(), PZ.z()); if (inDisk){
if (inDisk) cutEdges.insert(std::make_pair(me,newv)); MVertex *newv = new MVertex (PZ.x(), PZ.y(), PZ.z());
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.
Finish editing this message first!
Please register or to comment