diff --git a/src/db/db/dbTriangles.cc b/src/db/db/dbTriangles.cc index 69d7c324e..f0cd8c80c 100644 --- a/src/db/db/dbTriangles.cc +++ b/src/db/db/dbTriangles.cc @@ -37,7 +37,7 @@ namespace db { Triangles::Triangles () - : m_is_constrained (false), m_level (0), m_flips (0), m_hops (0) + : m_is_constrained (false), m_level (0), m_id (0), m_flips (0), m_hops (0) { // .. nothing yet .. } @@ -1414,8 +1414,8 @@ Triangles::remove_outside_triangles () void Triangles::clear () { - m_edges_heap.clear (); mp_triangles.clear (); + m_edges_heap.clear (); m_vertex_heap.clear (); m_returned_edges.clear (); m_is_constrained = false; diff --git a/src/db/unit_tests/dbTrianglesTests.cc b/src/db/unit_tests/dbTrianglesTests.cc index da142d189..9b542f376 100644 --- a/src/db/unit_tests/dbTrianglesTests.cc +++ b/src/db/unit_tests/dbTrianglesTests.cc @@ -63,6 +63,13 @@ TEST(basic) EXPECT_EQ (tris.to_string (), "((1, 0), (1, 4), (5, 0)), ((1, 4), (5, 4), (5, 0))"); EXPECT_EQ (tris.check (), true); + + tris.clear (); + + EXPECT_EQ (tris.bbox ().to_string (), "()"); + EXPECT_EQ (tris.to_string (), ""); + + EXPECT_EQ (tris.check (), true); } TEST(flip)