Skip to content

Commit

Permalink
Make sure logger is safely released in InfoLogLevel
Browse files Browse the repository at this point in the history
Summary: fix the memory leak that was captured by jenkin build.

Test Plan: ran the valgrind test locally

Reviewers: yhchiang

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16389
  • Loading branch information
liukai committed Feb 27, 2014
1 parent 444cafc commit e41c060
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/auto_roll_logger_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ TEST(AutoRollLoggerTest, InfoLogLevel) {
const int kInfoLogLevelNameLens[5] = {5, 4, 4, 5, 5};

size_t log_size = 8192;
AutoRollLogger* logger =
new AutoRollLogger(Env::Default(), kTestDir, "", log_size, 0);
std::unique_ptr<AutoRollLogger> logger_guard(
new AutoRollLogger(Env::Default(), kTestDir, "", log_size, 0));
auto logger = logger_guard.get();

int message_length = kSampleMessage.length();
int log_length = 0;
Expand Down

0 comments on commit e41c060

Please sign in to comment.