mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Add more precondition checks when handle async operation result
PR #19460.
This commit is contained in:
parent
2b69cabc2c
commit
67d340ad63
2 changed files with 10 additions and 3 deletions
|
@ -1602,6 +1602,7 @@ void TorrentImpl::applyFirstLastPiecePriority(const bool enabled)
|
|||
|
||||
void TorrentImpl::fileSearchFinished(const Path &savePath, const PathList &fileNames)
|
||||
{
|
||||
if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
|
||||
endReceivedMetadataHandling(savePath, fileNames);
|
||||
}
|
||||
|
||||
|
@ -1635,7 +1636,13 @@ std::shared_ptr<const libtorrent::torrent_info> TorrentImpl::nativeTorrentInfo()
|
|||
|
||||
void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames)
|
||||
{
|
||||
Q_ASSERT(m_maintenanceJob == MaintenanceJob::HandleMetadata);
|
||||
if (Q_UNLIKELY(m_maintenanceJob != MaintenanceJob::HandleMetadata))
|
||||
return;
|
||||
|
||||
Q_ASSERT(m_filePaths.isEmpty());
|
||||
if (Q_UNLIKELY(!m_filePaths.isEmpty()))
|
||||
m_filePaths.clear();
|
||||
|
||||
lt::add_torrent_params &p = m_ltAddTorrentParams;
|
||||
|
||||
|
|
Loading…
Reference in a new issue