mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Fixed assert so that it doesn't crash when we toggle paused state of a torrent several times and quickly
This commit is contained in:
parent
44d61e0b9d
commit
aa4c53ec43
1 changed files with 8 additions and 5 deletions
|
@ -934,12 +934,15 @@ void bittorrent::readAlerts(){
|
||||||
else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())){
|
else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())){
|
||||||
QString hash = QString(misc::toString(p->handle.info_hash()).c_str());
|
QString hash = QString(misc::toString(p->handle.info_hash()).c_str());
|
||||||
qDebug("Received torrent_paused_alert for %s", (const char*)hash.toUtf8());
|
qDebug("Received torrent_paused_alert for %s", (const char*)hash.toUtf8());
|
||||||
Q_ASSERT(!pausedTorrents.contains(hash));
|
if(!pausedTorrents.contains(hash)){
|
||||||
torrent_handle h = p->handle;
|
torrent_handle h = p->handle;
|
||||||
if(h.is_valid() && h.is_paused()){
|
if(h.is_valid() && h.is_paused()){
|
||||||
pausedTorrents << hash;
|
pausedTorrents << hash;
|
||||||
|
}else{
|
||||||
|
qDebug("Not adding torrent no pausedList, it is invalid or resumed");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
qDebug("Not adding torrent no pausedList, it is invalid or resumed");
|
qDebug("Received alert for already paused torrent");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (peer_blocked_alert* p = dynamic_cast<peer_blocked_alert*>(a.get())){
|
else if (peer_blocked_alert* p = dynamic_cast<peer_blocked_alert*>(a.get())){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue