Be more explicit about destructor calls
This commit is contained in:
parent
7c407c4b69
commit
f4d9d271ea
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user