1
mirror of https://github.com/qbittorrent/qBittorrent synced 2024-10-22 06:11:55 +02:00

Delete database file only after it is released

PR #18005.
This commit is contained in:
Vladimir Golovnev 2022-11-13 08:27:48 +03:00 committed by GitHub
parent b68c4e2106
commit dcdbd02102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1401,7 +1401,12 @@ void SessionImpl::endStartup(ResumeSessionContext *context)
context->startupStorage->deleteLater();
if (context->currentStorageType == ResumeDataStorageType::Legacy)
Utils::Fs::removeFile(dbPath);
{
connect(context->startupStorage, &QObject::destroyed, [dbPath]
{
Utils::Fs::removeFile(dbPath);
});
}
}
context->deleteLater();