Fixed heap-use-after-free error in compaction_job_test.cc

Summary: Fixed heap-use-after-free error in compaction_job_test.cc

Test Plan: compaction_job_test

Reviewers: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D39411
This commit is contained in:
Yueh-Hsuan Chiang 2015-06-02 16:20:23 -07:00
parent 8d8d4e45ba
commit 3083ed2129

View File

@ -163,11 +163,12 @@ TEST_F(CompactionJobTest, Simple) {
LogBuffer log_buffer(InfoLogLevel::INFO_LEVEL, db_options_.info_log.get());
mutex_.Lock();
EventLogger event_logger(db_options_.info_log.get());
std::string db_name = "dbname";
CompactionJob compaction_job(0, compaction.get(), db_options_, env_options_,
versions_.get(), &shutting_down_, &log_buffer,
nullptr, nullptr, nullptr, {}, table_cache_,
std::move(yield_callback), &event_logger, false,
"dbname");
db_name);
compaction_job.Prepare();
mutex_.Unlock();