make sure to cancel cache job on close

parent 076db9fe
......@@ -50,6 +50,10 @@ CacheJob::CacheJob(const QString &binId, int imageHeight, int thumbsCount, int i
m_imageHeight += m_imageHeight % 2;
auto item = pCore->projectItemModel()->getItemByBinId(binId);
Q_ASSERT(item != nullptr && item->itemType() == AbstractProjectItem::ClipItem);
connect(this, &CacheJob::jobCanceled, [&] () {
m_clipId.clear();
m_done = true;
});
}
const QString CacheJob::getDescription() const
......@@ -81,10 +85,6 @@ bool CacheJob::startJob()
}
int size = (int)frames.size();
int count = 0;
connect(this, &CacheJob::jobCanceled, [&] () {
m_clipId.clear();
m_done = true;
});
for (int i : frames) {
if (m_done) {
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment