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) {
|
void InMemoryBlockStore::remove(unique_ref<Block> block) {
|
||||||
Key key = block->key();
|
Key key = block->key();
|
||||||
//TODO Better way to destruct?
|
cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor
|
||||||
cpputils::to_unique_ptr(std::move(block)); // Destruct
|
|
||||||
int numRemoved = _blocks.erase(key.ToString());
|
int numRemoved = _blocks.erase(key.ToString());
|
||||||
assert(1==numRemoved);
|
assert(1==numRemoved);
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,7 @@ optional<unique_ref<Block>> OnDiskBlockStore::load(const Key &key) {
|
|||||||
|
|
||||||
void OnDiskBlockStore::remove(unique_ref<Block> block) {
|
void OnDiskBlockStore::remove(unique_ref<Block> block) {
|
||||||
Key key = block->key();
|
Key key = block->key();
|
||||||
//TODO Better way to destruct?
|
cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor
|
||||||
cpputils::to_unique_ptr(std::move(block)); // Destruct
|
|
||||||
OnDiskBlock::RemoveFromDisk(_rootdir, key);
|
OnDiskBlock::RemoveFromDisk(_rootdir, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,7 @@ optional<unique_ref<Block>> FakeBlockStore::load(const Key &key) {
|
|||||||
|
|
||||||
void FakeBlockStore::remove(unique_ref<Block> block) {
|
void FakeBlockStore::remove(unique_ref<Block> block) {
|
||||||
Key key = block->key();
|
Key key = block->key();
|
||||||
//TODO Better way to destruct
|
cpputils::to_unique_ptr(std::move(block)).reset(); // Call destructor
|
||||||
cpputils::to_unique_ptr(std::move(block)); // Destruct
|
|
||||||
int numRemoved = _blocks.erase(key.ToString());
|
int numRemoved = _blocks.erase(key.ToString());
|
||||||
assert(numRemoved == 1);
|
assert(numRemoved == 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user