Skip to content

Commit

Permalink
Don't break torrent checking
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Jul 14, 2019
1 parent 9462685 commit 87d9840
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/base/bittorrent/torrenthandle.cpp
Expand Up @@ -1437,6 +1437,12 @@ void TorrentHandle::toggleFirstLastPiecePriority()
void TorrentHandle::pause()
{
if (m_startupState != Started) return;
if (m_pauseWhenReady) return;
if (isChecking()) {
m_pauseWhenReady = true;
return;
}

if (isPaused()) return;

setAutoManaged(false);
Expand All @@ -1453,6 +1459,7 @@ void TorrentHandle::resume(bool forced)
{
if (m_startupState != Started) return;

m_pauseWhenReady = false;
resume_impl(forced);
}

Expand Down

0 comments on commit 87d9840

Please sign in to comment.