From 1c8b819be2e6f70bc3232bcba8ca522bcecad667 Mon Sep 17 00:00:00 2001 From: kailiu Date: Wed, 20 Nov 2013 13:45:32 -0800 Subject: [PATCH] Fix a memory leak happened in table_test --- table/table_test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/table/table_test.cc b/table/table_test.cc index e93e9bcec..394aa4b9d 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -252,11 +252,14 @@ class BlockBasedTableConstructor: public Constructor { virtual Status FinishImpl(const Options& options, const KVMap& data) { Reset(); sink_.reset(new StringSink()); + std::unique_ptr flush_policy_factory( + new FlushBlockBySizePolicyFactory(options.block_size, + options.block_size_deviation)); + BlockBasedTableBuilder builder( options, sink_.get(), - new FlushBlockBySizePolicyFactory( - options.block_size, options.block_size_deviation), + flush_policy_factory.get(), options.compression); for (KVMap::const_iterator it = data.begin();