From 2ccb794eb62e2ede1392016124a809b3768606f1 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Thu, 12 Mar 2020 14:27:51 -0700 Subject: [PATCH] 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 --- examples/column_families_example.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/column_families_example.cc b/examples/column_families_example.cc index df936d46a..0012e9dc1 100644 --- a/examples/column_families_example.cc +++ b/examples/column_families_example.cc @@ -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;