From a21152ab85fc998dec68036201d77e02ffee3d6a Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 21 Oct 2024 23:24:12 +0000 Subject: [PATCH] Use mutable lambda captures in AsyncDnsResolver::Start(). Otherwise, the captured variables are immutable, so a subsequent std::move() silently degrades to a copy. -- Add missing () for consistency with other no-arg lambda captures. Bug: webrtc:374845009 Change-Id: I205589ff8047446918a45203a22620846b271187 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366280 Reviewed-by: Harald Alvestrand Commit-Queue: Tomas Gunnarsson Reviewed-by: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#43289} --- rtc_base/async_dns_resolver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtc_base/async_dns_resolver.cc b/rtc_base/async_dns_resolver.cc index 8cbd21cb6d..cf27e23821 100644 --- a/rtc_base/async_dns_resolver.cc +++ b/rtc_base/async_dns_resolver.cc @@ -155,9 +155,9 @@ void AsyncDnsResolver::Start(const rtc::SocketAddress& addr, // We assume that the caller task queue is still around if the // AsyncDnsResolver has not been destroyed. state->Finish([this, error, flag, caller_task_queue, - addresses = std::move(addresses)]() { + addresses = std::move(addresses)]() mutable { caller_task_queue->PostTask( - SafeTask(flag, [this, error, addresses = std::move(addresses)] { + SafeTask(flag, [this, error, addresses = std::move(addresses)]() { RTC_DCHECK_RUN_ON(&result_.sequence_checker_); result_.addresses_ = addresses; result_.error_ = error;