mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-09-04 18:12:08 +00:00
Add more precondition checks when handle async operation result
PR #19460.
This commit is contained in:
parent
7a9a102b6f
commit
cab5edb721
@ -1598,6 +1598,7 @@ void TorrentImpl::applyFirstLastPiecePriority(const bool enabled)
|
|||||||
|
|
||||||
void TorrentImpl::fileSearchFinished(const Path &savePath, const PathList &fileNames)
|
void TorrentImpl::fileSearchFinished(const Path &savePath, const PathList &fileNames)
|
||||||
{
|
{
|
||||||
|
if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
|
||||||
endReceivedMetadataHandling(savePath, fileNames);
|
endReceivedMetadataHandling(savePath, fileNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1630,7 +1631,13 @@ std::shared_ptr<const libtorrent::torrent_info> TorrentImpl::nativeTorrentInfo()
|
|||||||
|
|
||||||
void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames)
|
void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(m_maintenanceJob == MaintenanceJob::HandleMetadata);
|
||||||
|
if (m_maintenanceJob != MaintenanceJob::HandleMetadata) [[unlikely]]
|
||||||
|
return;
|
||||||
|
|
||||||
Q_ASSERT(m_filePaths.isEmpty());
|
Q_ASSERT(m_filePaths.isEmpty());
|
||||||
|
if (!m_filePaths.isEmpty()) [[unlikely]]
|
||||||
|
m_filePaths.clear();
|
||||||
|
|
||||||
lt::add_torrent_params &p = m_ltAddTorrentParams;
|
lt::add_torrent_params &p = m_ltAddTorrentParams;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user