Use DestroyColumnFamilyHandle instead of directly deleting column family handle (#6505)
Summary: Update example usage of closing column family. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6505 Test Plan: cd examples && make column_families_example && ./column_families_example Differential Revision: D20362100 Pulled By: cheng-chang fbshipit-source-id: 493c5e0068a40b4f237f8f8511cddd22dc15ea5c
This commit is contained in:
parent
0d2c8e47e8
commit
2ccb794eb6
@ -28,7 +28,8 @@ int main() {
|
|||||||
assert(s.ok());
|
assert(s.ok());
|
||||||
|
|
||||||
// close DB
|
// close DB
|
||||||
delete cf;
|
s = db->DestroyColumnFamilyHandle(cf);
|
||||||
|
assert(s.ok());
|
||||||
delete db;
|
delete db;
|
||||||
|
|
||||||
// open DB with two column families
|
// open DB with two column families
|
||||||
@ -64,7 +65,8 @@ int main() {
|
|||||||
|
|
||||||
// close db
|
// close db
|
||||||
for (auto handle : handles) {
|
for (auto handle : handles) {
|
||||||
delete handle;
|
s = db->DestroyColumnFamilyHandle(handle);
|
||||||
|
assert(s.ok());
|
||||||
}
|
}
|
||||||
delete db;
|
delete db;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user