From a733d252d88919b1b8ce81058963f85227ef0c9e Mon Sep 17 00:00:00 2001 From: Stephane Rigaud Date: Wed, 20 Nov 2024 14:26:15 +0100 Subject: [PATCH] simplify destructor --- clic/src/array.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clic/src/array.cpp b/clic/src/array.cpp index b48a1ed9..0ea916eb 100644 --- a/clic/src/array.cpp +++ b/clic/src/array.cpp @@ -26,11 +26,9 @@ Array::~Array() { if (initialized()) { - if (data_.use_count() == 1 && get() != nullptr) - { - backend_.freeMemory(device(), mtype(), get()); - } + backend_.freeMemory(device(), mtype(), get()); data_.reset(); + initialized_ = false; } }