diff --git a/implementations/inmemory/InMemoryBlockStore.cpp b/implementations/inmemory/InMemoryBlockStore.cpp index ed21de88..0b627933 100644 --- a/implementations/inmemory/InMemoryBlockStore.cpp +++ b/implementations/inmemory/InMemoryBlockStore.cpp @@ -43,8 +43,7 @@ optional> InMemoryBlockStore::load(const Key &key) { void InMemoryBlockStore::remove(unique_ref block) { Key key = block->key(); - //TODO Better way to destruct? - cpputils::to_unique_ptr(std::move(block)); // Destruct + cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor int numRemoved = _blocks.erase(key.ToString()); assert(1==numRemoved); } diff --git a/implementations/ondisk/OnDiskBlockStore.cpp b/implementations/ondisk/OnDiskBlockStore.cpp index 0affe05a..2e4de86f 100644 --- a/implementations/ondisk/OnDiskBlockStore.cpp +++ b/implementations/ondisk/OnDiskBlockStore.cpp @@ -32,8 +32,7 @@ optional> OnDiskBlockStore::load(const Key &key) { void OnDiskBlockStore::remove(unique_ref block) { Key key = block->key(); - //TODO Better way to destruct? - cpputils::to_unique_ptr(std::move(block)); // Destruct + cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor OnDiskBlock::RemoveFromDisk(_rootdir, key); } diff --git a/implementations/testfake/FakeBlockStore.cpp b/implementations/testfake/FakeBlockStore.cpp index d4673160..51abce98 100644 --- a/implementations/testfake/FakeBlockStore.cpp +++ b/implementations/testfake/FakeBlockStore.cpp @@ -42,8 +42,7 @@ optional> FakeBlockStore::load(const Key &key) { void FakeBlockStore::remove(unique_ref block) { Key key = block->key(); - //TODO Better way to destruct - cpputils::to_unique_ptr(std::move(block)); // Destruct + cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor int numRemoved = _blocks.erase(key.ToString()); assert(numRemoved == 1); }