fix: crash when editing tracker list immediately after editing torrent (#8469)

This commit is contained in:
Charles Kerr
2026-02-13 08:00:35 -06:00
committed by GitHub
parent 6ae3abc7c1
commit 57965724cb

View File

@@ -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);
}
}