From fb36f5d55d517cb4f97fd215fe692db68f0faabc Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Tue, 24 Dec 2024 23:26:24 +0800 Subject: [PATCH] fix: shadowed variable warning in `tr_torrentVerify()` (#7305) --- libtransmission/torrent.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index 8ea4c6acb..ca7dc82c5 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -1601,13 +1601,12 @@ void tr_torrentStartNow(tr_torrent* tor) void tr_torrentVerify(tr_torrent* tor) { tor->session->run_in_session_thread( - [session = tor->session, tor_id = tor->id()]() + [tor, session = tor->session, tor_id = tor->id()]() { TR_ASSERT(session->am_in_session_thread()); auto const lock = session->unique_lock(); - auto* const tor = session->torrents().get(tor_id); - if (tor == nullptr || tor->is_deleting_) + if (tor != session->torrents().get(tor_id) || tor->is_deleting_) { return; }