diff --git a/include/rocksdb/utilities/write_batch_with_index.h b/include/rocksdb/utilities/write_batch_with_index.h index 08852bc3d..8c519fe5c 100644 --- a/include/rocksdb/utilities/write_batch_with_index.h +++ b/include/rocksdb/utilities/write_batch_with_index.h @@ -12,6 +12,7 @@ #ifndef ROCKSDB_LITE +#include #include #include "rocksdb/comparator.h" @@ -205,7 +206,7 @@ class WriteBatchWithIndex : public WriteBatchBase { private: struct Rep; - Rep* rep; + std::unique_ptr rep; }; } // namespace rocksdb diff --git a/utilities/write_batch_with_index/write_batch_with_index.cc b/utilities/write_batch_with_index/write_batch_with_index.cc index 68c8d4c64..c92735fac 100644 --- a/utilities/write_batch_with_index/write_batch_with_index.cc +++ b/utilities/write_batch_with_index/write_batch_with_index.cc @@ -570,7 +570,7 @@ WriteBatchWithIndex::WriteBatchWithIndex( bool overwrite_key) : rep(new Rep(default_index_comparator, reserved_bytes, overwrite_key)) {} -WriteBatchWithIndex::~WriteBatchWithIndex() { delete rep; } +WriteBatchWithIndex::~WriteBatchWithIndex() {} WriteBatch* WriteBatchWithIndex::GetWriteBatch() { return &rep->write_batch; }