From e803b9403d663c35478ee1dfed339f1d1114f1db Mon Sep 17 00:00:00 2001 From: Alex Owens Date: Fri, 1 Nov 2024 15:53:27 +0000 Subject: [PATCH] Fix mem freeing in ComponentManager --- cpp/arcticdb/processing/component_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/arcticdb/processing/component_manager.cpp b/cpp/arcticdb/processing/component_manager.cpp index 36544db71b..187ef90d1b 100644 --- a/cpp/arcticdb/processing/component_manager.cpp +++ b/cpp/arcticdb/processing/component_manager.cpp @@ -20,7 +20,7 @@ std::vector ComponentManager::get_new_entity_ids(size_t count) { } void ComponentManager::decrement_entity_fetch_count(EntityId id) { - if (registry_.get>(id).fetch_sub(1) == 0) { + if (registry_.get>(id).fetch_sub(1) == 1) { // This entity will never be accessed again // Ideally would call registry_.destroy(id), or at least registry_.erase>(id) // at this point. However, they are both slower than this, and would require taking a unique_lock on the