diff --git a/src/Memory/__OptionalUniquePtrList.hpp b/src/Memory/__OptionalUniquePtrList.hpp index cd64c6a..f6ca1a8 100644 --- a/src/Memory/__OptionalUniquePtrList.hpp +++ b/src/Memory/__OptionalUniquePtrList.hpp @@ -38,6 +38,7 @@ namespace ArbUt { for (auto& i : _vector) { delete i; } + _vector.clear(); } /// @brief Borrow a pointer at a certain index. diff --git a/src/Memory/__UniquePtrList.hpp b/src/Memory/__UniquePtrList.hpp index f720ed4..1322488 100644 --- a/src/Memory/__UniquePtrList.hpp +++ b/src/Memory/__UniquePtrList.hpp @@ -43,6 +43,7 @@ namespace ArbUt { for (auto& i : _vector) { delete i; } + _vector.clear(); } /// @brief Borrow a pointer at a certain index.