diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn index 0758b0a870..63564a632f 100644 --- a/modules/remote_bitrate_estimator/BUILD.gn +++ b/modules/remote_bitrate_estimator/BUILD.gn @@ -33,10 +33,8 @@ rtc_static_library("remote_bitrate_estimator") { if (rtc_enable_bwe_test_logging) { defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ] - configs += [ - "../..:no_exit_time_destructors", - "../..:no_global_constructors", - ] + + configs += [ "../..:no_exit_time_destructors" ] sources += [ "test/bwe_test_logging.cc" ] } else { defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ] diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc index 1b4cae2f47..0778040eb0 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc +++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc @@ -26,8 +26,6 @@ namespace webrtc { namespace testing { namespace bwe { -Logging Logging::g_Logging; - static std::string ToString(uint32_t v) { rtc::StringBuilder ss; ss << v; @@ -58,7 +56,8 @@ Logging::Context::~Context() { } Logging* Logging::GetInstance() { - return &g_Logging; + static Logging* logging = new Logging(); + return logging; } void Logging::SetGlobalContext(uint32_t name) { diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h index 20a29cc793..6e0f66a7e4 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h +++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h @@ -346,7 +346,6 @@ class Logging { bool enabled); void PopState(); - static Logging g_Logging; rtc::CriticalSection crit_sect_; ThreadMap thread_map_;