Be more explicit about destructor calls

This commit is contained in:
Sebastian Messmer 2015-07-21 14:56:32 +02:00
parent 7c407c4b69
commit f4d9d271ea
3 changed files with 3 additions and 6 deletions

View File

@ -43,8 +43,7 @@ optional<unique_ref<Block>> InMemoryBlockStore::load(const Key &key) {
void InMemoryBlockStore::remove(unique_ref<Block> 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);
}

View File

@ -32,8 +32,7 @@ optional<unique_ref<Block>> OnDiskBlockStore::load(const Key &key) {
void OnDiskBlockStore::remove(unique_ref<Block> 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);
}

View File

@ -42,8 +42,7 @@ optional<unique_ref<Block>> FakeBlockStore::load(const Key &key) {
void FakeBlockStore::remove(unique_ref<Block> 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);
}