diff --git a/rtc_base/synchronization/sequence_checker_internal.cc b/rtc_base/synchronization/sequence_checker_internal.cc index 63badd9538..c03ee94d1b 100644 --- a/rtc_base/synchronization/sequence_checker_internal.cc +++ b/rtc_base/synchronization/sequence_checker_internal.cc @@ -51,7 +51,7 @@ bool SequenceCheckerImpl::IsCurrent() const { valid_system_queue_ = current_system_queue; return true; } - if (valid_queue_ || current_queue) { + if (valid_queue_) { return valid_queue_ == current_queue; } if (valid_system_queue_ && valid_system_queue_ == current_system_queue) { diff --git a/rtc_base/unique_id_generator_unittest.cc b/rtc_base/unique_id_generator_unittest.cc index 835a57e162..dc5e9c245f 100644 --- a/rtc_base/unique_id_generator_unittest.cc +++ b/rtc_base/unique_id_generator_unittest.cc @@ -187,6 +187,9 @@ TEST(UniqueNumberGeneratorDeathTest, FailsWhenUsedInWrongContext) { // thread/sequence checkers will pick up a different thread environment than // `fake_task_queue` will represent. UniqueNumberGenerator generator; + + // Instantiate a fake task queue that will register itself as the current tq. + FakeTaskQueue initial_fake_task_queue; // Generate an ID on the current thread. This causes the generator to attach // to the current thread context. generator.GenerateNumber();