From 87d98403f400674cc5d06853c167cc6472bcf20c Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 14 Jul 2019 11:50:44 +0300 Subject: [PATCH] Don't break torrent checking --- src/base/bittorrent/torrenthandle.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index dcf8a7ae7..006298cc5 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -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); @@ -1453,6 +1459,7 @@ void TorrentHandle::resume(bool forced) { if (m_startupState != Started) return; + m_pauseWhenReady = false; resume_impl(forced); }