diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 833f395dac..8735cb4782 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -68,8 +68,10 @@ RtcEventLogImpl::RtcEventLogImpl(RtcEventLog::EncodingType encoding_type, RtcEventLogImpl::~RtcEventLogImpl() { // If we're logging to the output, this will stop that. Blocking function. - if (logging_state_started_) + if (logging_state_started_) { + logging_state_checker_.Detach(); StopLogging(); + } // We want to block on any executing task by invoking ~TaskQueue() before // we set unique_ptr's internal pointer to null.