mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Discard obsolete "state update" events after torrent is reloaded
PR #21873. Closes #21827.
This commit is contained in:
parent
ac9ca4f452
commit
71b752baf3
1 changed files with 6 additions and 0 deletions
|
@ -2625,6 +2625,12 @@ bool TorrentImpl::isMoveInProgress() const
|
|||
|
||||
void TorrentImpl::updateStatus(const lt::torrent_status &nativeStatus)
|
||||
{
|
||||
// Since libtorrent alerts are handled asynchronously there can be obsolete
|
||||
// "state update" event reached here after torrent was reloaded in libtorrent.
|
||||
// Just discard such events.
|
||||
if (nativeStatus.handle != m_nativeHandle) [[unlikely]]
|
||||
return;
|
||||
|
||||
const lt::torrent_status oldStatus = std::exchange(m_nativeStatus, nativeStatus);
|
||||
|
||||
if (m_nativeStatus.num_pieces != oldStatus.num_pieces)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue