mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-29 00:34:03 +00:00
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());
|
||||
|
||||
// close DB
|
||||
delete cf;
|
||||
s = db->DestroyColumnFamilyHandle(cf);
|
||||
assert(s.ok());
|
||||
delete db;
|
||||
|
||||
// open DB with two column families
|
||||
|
@ -64,7 +65,8 @@ int main() {
|
|||
|
||||
// close db
|
||||
for (auto handle : handles) {
|
||||
delete handle;
|
||||
s = db->DestroyColumnFamilyHandle(handle);
|
||||
assert(s.ok());
|
||||
}
|
||||
delete db;
|
||||
|
||||
|
|
Loading…
Reference in a new issue