mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Fix dangling reference in ZRefinement
This commit is contained in:
parent
482bcb83d5
commit
cee5d55b7d
@ -6357,6 +6357,8 @@ namespace netgen
|
|||||||
for(auto si : Range(segments))
|
for(auto si : Range(segments))
|
||||||
{
|
{
|
||||||
auto& seg = segments[si];
|
auto& seg = segments[si];
|
||||||
|
// Copy segment, as reference above might get invalidated in AddSegment()
|
||||||
|
auto reference_seg = seg;
|
||||||
auto p1 = seg[0];
|
auto p1 = seg[0];
|
||||||
auto p2 = seg[1];
|
auto p2 = seg[1];
|
||||||
|
|
||||||
@ -6376,7 +6378,7 @@ namespace netgen
|
|||||||
seg[1] = ipts[1];
|
seg[1] = ipts[1];
|
||||||
for(auto i : Range(size_t(1), ipts.Size()-1))
|
for(auto i : Range(size_t(1), ipts.Size()-1))
|
||||||
{
|
{
|
||||||
Segment snew = seg;
|
Segment snew = reference_seg;
|
||||||
if(c2)
|
if(c2)
|
||||||
{
|
{
|
||||||
snew[0] = ipts[ipts.Size()-1-i];
|
snew[0] = ipts[ipts.Size()-1-i];
|
||||||
|
Loading…
Reference in New Issue
Block a user