From f1e276f13359257c10c8f89fbacb90ff611b3269 Mon Sep 17 00:00:00 2001 From: "Krinkin, Mike" Date: Thu, 20 Feb 2025 19:12:39 +0000 Subject: [PATCH] test: Don't capture local objects by reference in lambda (#38505) Signed-off-by: Mikhail Krinkin --- test/integration/fake_upstream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/fake_upstream.cc b/test/integration/fake_upstream.cc index 6764d30d98c6..d54a77fced4c 100644 --- a/test/integration/fake_upstream.cc +++ b/test/integration/fake_upstream.cc @@ -980,7 +980,7 @@ AssertionResult FakeUpstream::runOnDispatcherThreadAndWait(std::function cb) { ASSERT(!dispatcher_->isThreadSafe()); - dispatcher_->post([&]() { cb(); }); + dispatcher_->post([cb = std::move(cb)]() { cb(); }); } void FakeUpstream::sendUdpDatagram(const std::string& buffer,