From ff7e537b34b2a532434295ce8d7e5f1cddc0b529 Mon Sep 17 00:00:00 2001 From: Havret Date: Thu, 9 Jan 2025 11:27:02 +0100 Subject: [PATCH] Destroy old column family handle after new one was created --- src/RocksDb.Extensions/RocksDbAccessor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RocksDb.Extensions/RocksDbAccessor.cs b/src/RocksDb.Extensions/RocksDbAccessor.cs index a8aa34e..52c27ad 100644 --- a/src/RocksDb.Extensions/RocksDbAccessor.cs +++ b/src/RocksDb.Extensions/RocksDbAccessor.cs @@ -352,8 +352,11 @@ public bool HasKey(TKey key) public void Clear() { + var prevColumnFamilyHandle = _columnFamily.Handle; _rocksDbContext.Db.DropColumnFamily(_columnFamily.Name); _columnFamily.Handle = _rocksDbContext.Db.CreateColumnFamily(_rocksDbContext.ColumnFamilyOptions, _columnFamily.Name); + + Native.Instance.rocksdb_column_family_handle_destroy(prevColumnFamilyHandle.Handle); } }