Page MenuHomePhorge

D177.1732569499.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D177.1732569499.diff

diff --git a/src/kazv-io-manager.cpp b/src/kazv-io-manager.cpp
--- a/src/kazv-io-manager.cpp
+++ b/src/kazv-io-manager.cpp
@@ -46,7 +46,7 @@
*/
QDir cacheDir{tmpDir.path()};
Kazv::RandomInterface randomGenerator = QtRandAdapter{};
- QMap<QString, QSharedPointer<KazvIODownloadJob>> cacheJobs;
+ QMap<QString, QPointer<KazvIODownloadJob>> cacheJobs;
QMap<QString, QSharedPointer<KazvIODownloadJob>> downloadJobs;
QMap<QString, QSharedPointer<UploadJobModel>> uploadJobs;
};
@@ -80,8 +80,9 @@
QDir dir(m_d->cacheDir.path());
if (!dir.exists(id) && this->getCacheJob(id) == nullptr) {
auto job = this->makeDownloadJob(fileUrl, QUrl::fromLocalFile(filePath), hash, key, iv);
- m_d->cacheJobs[id].reset(job);
+ m_d->cacheJobs[id] = job;
connect(job, &KazvIOBaseJob::result, this, [this, id](auto /* result */) {
+ m_d->cacheJobs[id]->deleteLater();
m_d->cacheJobs.remove(id);
});
}
@@ -184,6 +185,10 @@
void KazvIOManager::clearJobs()
{
+ auto cacheJobKeys = m_d->cacheJobs.keys();
+ std::for_each(cacheJobKeys.begin(), cacheJobKeys.end(), [this](auto key) {
+ m_d->cacheJobs[key]->cancel();
+ });
std::for_each(m_d->downloadJobs.begin(), m_d->downloadJobs.end(), [this](auto job){
job->cancel();
});

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 1:18 PM (11 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40339
Default Alt Text
D177.1732569499.diff (1 KB)

Event Timeline