Skip to content

Commit

Permalink
Destroy old column family handle after new one was created
Browse files Browse the repository at this point in the history
  • Loading branch information
Havret committed Jan 9, 2025
1 parent 1493b3e commit ff7e537
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/RocksDb.Extensions/RocksDbAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit ff7e537

Please sign in to comment.