mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-23 01:40:00 +00:00
Discard obsolete "state update" events after torrent is reloaded
PR #21873. Closes #21827.
This commit is contained in:
parent
7f901a812d
commit
88161a6467
@ -2635,6 +2635,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…
Reference in New Issue
Block a user