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:
Cheng Chang 2020-03-12 14:27:51 -07:00 committed by Facebook GitHub Bot
parent 0d2c8e47e8
commit 2ccb794eb6

View File

@ -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;