Skip to content

Commit 7b10fe9

Browse files
liukaisiying
authored andcommitted
Fix a memory leak happened in table_test
1 parent b59d4d5 commit 7b10fe9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

table/table_test.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,14 @@ class BlockBasedTableConstructor: public Constructor {
252252
virtual Status FinishImpl(const Options& options, const KVMap& data) {
253253
Reset();
254254
sink_.reset(new StringSink());
255+
std::unique_ptr<FlushBlockBySizePolicyFactory> flush_policy_factory(
256+
new FlushBlockBySizePolicyFactory(options.block_size,
257+
options.block_size_deviation));
258+
255259
BlockBasedTableBuilder builder(
256260
options,
257261
sink_.get(),
258-
new FlushBlockBySizePolicyFactory(
259-
options.block_size, options.block_size_deviation),
262+
flush_policy_factory.get(),
260263
options.compression);
261264

262265
for (KVMap::const_iterator it = data.begin();

0 commit comments

Comments
 (0)