Display error message when unrecoverable error occurred

PR #19462.
This commit is contained in:
Vladimir Golovnev 2023-08-14 16:03:57 +03:00 committed by GitHub
parent cab5edb721
commit a0e41a11de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 21 deletions

View file

@ -3103,8 +3103,16 @@ void SessionImpl::generateResumeData()
void SessionImpl::saveResumeData()
{
for (const TorrentImpl *torrent : asConst(m_torrents))
torrent->nativeHandle().save_resume_data(lt::torrent_handle::only_if_modified);
m_numResumeData += m_torrents.size();
{
// When the session is terminated due to unrecoverable error
// some of the torrent handles can be corrupted
try
{
torrent->nativeHandle().save_resume_data(lt::torrent_handle::only_if_modified);
++m_numResumeData;
}
catch (const std::exception &) {}
}
// clear queued storage move jobs except the current ongoing one
if (m_moveStorageQueue.size() > 1)