diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index cc70f69b5..a53ae2df9 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -544,6 +544,10 @@ class BackupableDBTest : public testing::Test { std::string dbname_; std::string backupdir_; + // logger_ must be above backup_engine_ such that the engine's destructor, + // which uses a raw pointer to the logger, executes first. + std::shared_ptr logger_; + // envs Env* env_; unique_ptr mock_env_; @@ -558,7 +562,6 @@ class BackupableDBTest : public testing::Test { // options Options options_; - std::shared_ptr logger_; protected: unique_ptr backupable_options_;