Detach thread checker in RtcEventLogImpl destructor.
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 <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29793}
diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc
index 833f395..8735cb4 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() {
// 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.