mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07: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)
|
void TorrentImpl::fileSearchFinished(const Path &savePath, const PathList &fileNames)
|
||||||
{
|
{
|
||||||
|
if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
|
||||||
endReceivedMetadataHandling(savePath, fileNames);
|
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)
|
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());
|
Q_ASSERT(m_filePaths.isEmpty());
|
||||||
|
if (Q_UNLIKELY(!m_filePaths.isEmpty()))
|
||||||
|
m_filePaths.clear();
|
||||||
|
|
||||||
lt::add_torrent_params &p = m_ltAddTorrentParams;
|
lt::add_torrent_params &p = m_ltAddTorrentParams;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue