From 6ef9a6d67bececfd44fba4d0901eab78e874b9ac Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 14 Apr 2021 19:27:56 +0200 Subject: [PATCH] When calling Clear on UniquePtrList, also clear the vector. --- src/Memory/__OptionalUniquePtrList.hpp | 1 + src/Memory/__UniquePtrList.hpp | 1 + 2 files changed, 2 insertions(+) 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.