Skip to content

Commit

Permalink
Fix mem freeing in ComponentManager
Browse files Browse the repository at this point in the history
  • Loading branch information
alexowens90 committed Nov 1, 2024
1 parent f7955b3 commit e803b94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/arcticdb/processing/component_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ std::vector<EntityId> ComponentManager::get_new_entity_ids(size_t count) {
}

void ComponentManager::decrement_entity_fetch_count(EntityId id) {
if (registry_.get<std::atomic<EntityFetchCount>>(id).fetch_sub(1) == 0) {
if (registry_.get<std::atomic<EntityFetchCount>>(id).fetch_sub(1) == 1) {
// This entity will never be accessed again
// Ideally would call registry_.destroy(id), or at least registry_.erase<std::shared_ptr<SegmentInMemory>>(id)
// at this point. However, they are both slower than this, and would require taking a unique_lock on the
Expand Down

0 comments on commit e803b94

Please sign in to comment.