diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 23d5b939013..766576ff23b 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -612,6 +612,7 @@ void Compact_container::merge(Self &d) set_type(d.first_item, last_item, BLOCK_BOUNDARY); last_item = d.last_item; } + all_items.insert(all_items.end(), d.all_items.begin(), d.all_items.end()); // Add the sizes. size_ += d.size_; // Add the capacities. diff --git a/STL_Extension/include/CGAL/Handle_with_policy.h b/STL_Extension/include/CGAL/Handle_with_policy.h index df463d2d321..905a5435758 100644 --- a/STL_Extension/include/CGAL/Handle_with_policy.h +++ b/STL_Extension/include/CGAL/Handle_with_policy.h @@ -555,6 +555,7 @@ public: } } else { h.delete_rep( rep); // we have to delete the current rep + tmp->remove_reference(); } rep = tmp; } diff --git a/STL_Extension/test/STL_Extension/test_In_place_list.cpp b/STL_Extension/test/STL_Extension/test_In_place_list.cpp index 60488c18497..5a31a88d0ae 100644 --- a/STL_Extension/test/STL_Extension/test_In_place_list.cpp +++ b/STL_Extension/test/STL_Extension/test_In_place_list.cpp @@ -884,10 +884,11 @@ void test_In_place_list() { assert( l.size() == 5); assert( std::equal( l.begin(), l.end(), b)); } + { typedef CGAL::In_place_list ContList; typedef CGAL::In_place_list::iterator Iterator; - + ContList L; L.push_back(* new Cont(3)); L.push_back(* new Cont(5)); @@ -900,7 +901,10 @@ void test_In_place_list() { for (++it2; it2 != L.end(); it1=it2, ++it2) { assert( (*it1).i_ <= (*it2).i_ ); } + + L.destroy(); } + } int main() { diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index c2ecc068ab5..9f5a096b414 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -1663,7 +1663,7 @@ void test_Iterator_project() l.destroy(); l2.destroy(); } - + // // //============================================ @@ -1990,7 +1990,7 @@ void test_Iterator_project() l.destroy(); l2.destroy(); } - + // // //============================================ @@ -2888,8 +2888,14 @@ void test_Iterator_project() } CGAL::Assert_iterator( c_begin); CGAL::Assert_iterator( c_end); + + while(! l.empty()){ + delete static_cast(l.back()); + l.pop_back(); } - + + } + // // //============================================ @@ -5172,6 +5178,7 @@ void test_Circulator_on_node() { delete start; start = p; } + delete end; } } void test_N_step_adaptor() {