mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
avoid memory leak and cleanup
This commit is contained in:
parent
e5bb1298d2
commit
7bb3698043
@ -99,7 +99,7 @@ namespace netgen
|
|||||||
// map from unv element nr to our element number + an index if it is vol (0), bnd(1), ...
|
// map from unv element nr to our element number + an index if it is vol (0), bnd(1), ...
|
||||||
std::map<size_t, std::tuple<size_t, int>> element_map;
|
std::map<size_t, std::tuple<size_t, int>> element_map;
|
||||||
|
|
||||||
Array<Segment, 0, size_t> tmp_segments;
|
Array<Segment> tmp_segments;
|
||||||
while (in.good())
|
while (in.good())
|
||||||
{
|
{
|
||||||
in >> reco;
|
in >> reco;
|
||||||
@ -258,9 +258,8 @@ namespace netgen
|
|||||||
ed.SetSurfNr(0,bcpr);//?
|
ed.SetSurfNr(0,bcpr);//?
|
||||||
ednr = mesh.AddEdgeDescriptor(ed);
|
ednr = mesh.AddEdgeDescriptor(ed);
|
||||||
mesh.SetCD2Name(bcpr, name);
|
mesh.SetCD2Name(bcpr, name);
|
||||||
string * bcname = new string(name);
|
|
||||||
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
||||||
mesh.LineSegment(nr+1).SetBCName(bcname);
|
mesh.LineSegment(nr+1).SetBCName(mesh.GetCD2NamePtr(mesh.GetNCD2Names()));
|
||||||
mesh.LineSegment(nr+1).edgenr = ednr+1;
|
mesh.LineSegment(nr+1).edgenr = ednr+1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -283,10 +282,9 @@ namespace netgen
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
if (i==0)
|
|
||||||
continue;
|
|
||||||
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
auto nr = mesh.AddSegment(tmp_segments[get<0>(element_map[index])-1]);
|
||||||
mesh.LineSegment(nr+1).edgenr = ednr+1;
|
mesh.LineSegment(nr+1).edgenr = ednr+1;
|
||||||
|
mesh.LineSegment(nr+1).SetBCName(mesh.GetCD2NamePtr(mesh.GetNCD2Names()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user