diff --git a/memtable.cc b/memtable.cc index 4b331949c5..ca327ce0ec 100644 --- a/memtable.cc +++ b/memtable.cc @@ -10,6 +10,10 @@ memtable::memtable(schema_ptr schema) , partitions(partition_entry::compare(_schema)) { } +memtable::~memtable() { + partitions.clear_and_dispose(std::default_delete()); +} + memtable::const_mutation_partition_ptr memtable::find_partition(const dht::decorated_key& key) const { auto i = partitions.find(key, partition_entry::compare(_schema)); diff --git a/memtable.hh b/memtable.hh index 37c0831297..6c01aac039 100644 --- a/memtable.hh +++ b/memtable.hh @@ -76,6 +76,7 @@ public: using const_mutation_partition_ptr = std::unique_ptr; public: explicit memtable(schema_ptr schema); + ~memtable(); schema_ptr schema() const { return _schema; } mutation_partition& find_or_create_partition(const dht::decorated_key& key); mutation_partition& find_or_create_partition_slow(partition_key_view key);