From 60bd1aea3d6dc650264ddaeaa0b1f5bce19bb05a Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Wed, 13 Nov 2019 14:26:25 +0100 Subject: [PATCH] Detach thread checker in RtcEventLogImpl destructor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we require that the destructor must run on the same thread as previous calls. This is not necessary since we can assume there's no other references to the instance when we enter the destructor. Bug: webrtc:9883 Change-Id: Ia254bce9265979da0e25ba33598edd8f807d7e00 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159704 Reviewed-by: Björn Terelius Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#29793} --- logging/rtc_event_log/rtc_event_log_impl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.