From 034e3316eb4e3b6a4508f34bde2b1049c681542c Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 23 Nov 2022 20:11:12 +0100 Subject: [PATCH] fix: Don't use copy of mutex/condition in long-lived lock thread This was kind of due to a typo in 0babd33e84147e923a729ee07a3b85097ec8baa8. Since the LongLivedLockFile class is not used yet, the bug does not affect any released code. --- src/util/LockFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/LockFile.cpp b/src/util/LockFile.cpp index 4848eb64d..4636e68e5 100644 --- a/src/util/LockFile.cpp +++ b/src/util/LockFile.cpp @@ -366,7 +366,7 @@ LongLivedLockFile::on_after_acquire() } LOG_RAW("Starting keep-alive thread"); - m_keep_alive_thread = std::thread([=] { + m_keep_alive_thread = std::thread([&] { while (true) { std::unique_lock lock(m_stop_keep_alive_mutex); m_stop_keep_alive_condition.wait_for( -- 2.47.2