Browse Source

Merge pull request #12944 from glassez/hotfix

Fix invalid assertion
adaptive-webui-19844
Vladimir Golovnev 5 years ago committed by GitHub
parent
commit
68d4dc34db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/base/bittorrent/session.cpp

6
src/base/bittorrent/session.cpp

@ -4685,7 +4685,8 @@ void Session::handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p) @@ -4685,7 +4685,8 @@ void Session::handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p)
if (removingTorrentDataIter == m_removingTorrents.end())
return;
Q_ASSERT(removingTorrentDataIter->pathsToRemove.count() == 1);
Q_ASSERT(removingTorrentDataIter->pathsToRemove.count() <= 1);
if (!removingTorrentDataIter->pathsToRemove.isEmpty())
Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathsToRemove.first());
LogMsg(tr("'%1' was removed from the transfer list and hard disk.", "'xxx.avi' was removed...").arg(removingTorrentDataIter->name));
m_removingTorrents.erase(removingTorrentDataIter);
@ -4701,7 +4702,8 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale @@ -4701,7 +4702,8 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale
// libtorrent won't delete the directory if it contains files not listed in the torrent,
// so we remove the directory ourselves
Q_ASSERT(removingTorrentDataIter->pathsToRemove.count() == 1);
Q_ASSERT(removingTorrentDataIter->pathsToRemove.count() <= 1);
if (!removingTorrentDataIter->pathsToRemove.isEmpty())
Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathsToRemove.first());
if (p->error) {

Loading…
Cancel
Save