From 57965724cb8d016ed913bb1490aedb39f6b5d2d6 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 13 Feb 2026 08:00:35 -0600 Subject: [PATCH] fix: crash when editing tracker list immediately after editing torrent (#8469) --- libtransmission/announcer.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libtransmission/announcer.cc b/libtransmission/announcer.cc index 0a0c07782..ed487e88b 100644 --- a/libtransmission/announcer.cc +++ b/libtransmission/announcer.cc @@ -1802,15 +1802,19 @@ void tr_announcer_impl::resetTorrent(tr_torrent* tor) } } - // kickstart any tiers that didn't get started - if (tor->is_running()) + // kickstart any tiers that didn't get started: + // 1. ensure every tier has a current tracker + // 2. if we weren't already talking to the current tracker, then say hello + auto const is_running = tor->is_running(); + auto const now = tr_time(); + for (auto& tier : newer->tiers) { - auto const now = tr_time(); - for (auto& tier : newer->tiers) + if (!tier.current_tracker_index_) { - if (!tier.current_tracker_index_) + tier.useNextTracker(); + + if (is_running) { - tier.useNextTracker(); tier_announce_event_push(&tier, TR_ANNOUNCE_EVENT_STARTED, now); } }