From e461c69a5db9a650c7d791a829ddcb7db17268de Mon Sep 17 00:00:00 2001 From: Andreja Tonev Date: Mon, 26 Feb 2024 19:43:07 +0100 Subject: [PATCH] Bugfix: Using reference in a callback --- src/storage/v2/replication/replication_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/v2/replication/replication_client.cpp b/src/storage/v2/replication/replication_client.cpp index a581201c1..ed419bd5b 100644 --- a/src/storage/v2/replication/replication_client.cpp +++ b/src/storage/v2/replication/replication_client.cpp @@ -215,11 +215,11 @@ bool ReplicationStorageClient::FinalizeTransactionReplication(Storage *storage, MG_ASSERT(replica_stream_, "Missing stream for transaction deltas"); try { auto response = replica_stream_->Finalize(); - return replica_state_.WithLock([storage, &response, db_acc = std::move(db_acc), this](auto &state) mutable { + return replica_state_.WithLock([storage, response, db_acc = std::move(db_acc), this](auto &state) mutable { replica_stream_.reset(); if (!response.success || state == replication::ReplicaState::RECOVERY) { state = replication::ReplicaState::RECOVERY; - client_.thread_pool_.AddTask([storage, &response, db_acc = std::move(db_acc), this] { + client_.thread_pool_.AddTask([storage, response, db_acc = std::move(db_acc), this] { this->RecoverReplica(response.current_commit_timestamp, storage); }); return false;