File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1054,12 +1054,12 @@ bool Poly2TriTriangulator::insert_refinement_points()
10541054 libmesh_assert (new_node );
10551055
10561056 // Find the Delaunay cavity around the new point.
1057- std ::set < Elem * > cavity ;
1057+ std ::set < Elem * , decltype ( comp ) > cavity ( comp ) ;
10581058
1059- std ::set < Elem * > unchecked_cavity {cavity_elem };
1059+ std ::set < Elem * , decltype ( comp ) > unchecked_cavity ( {cavity_elem }, comp ) ;
10601060 while (!unchecked_cavity .empty ())
10611061 {
1062- std ::set < Elem * > checking_cavity ;
1062+ std ::set < Elem * , decltype ( comp ) > checking_cavity ( comp ) ;
10631063 checking_cavity .swap (unchecked_cavity );
10641064 for (Elem * checking_elem : checking_cavity )
10651065 {
@@ -1211,7 +1211,13 @@ bool Poly2TriTriangulator::insert_refinement_points()
12111211 }
12121212
12131213 boundary_info .remove (old_elem );
1214+ }
12141215
1216+ // Now that we're done using our cavity elems (including with a
1217+ // cavity.find() that used a comparator that dereferences the
1218+ // elmeents!) it's safe to delete them.
1219+ for (Elem * old_elem : cavity )
1220+ {
12151221 auto it = new_elems .find (old_elem );
12161222 if (it == new_elems .end ())
12171223 mesh .delete_elem (old_elem );
You can’t perform that action at this time.
0 commit comments