Fix crash on cancel clip job & correctly handle abortion of stabilize job

parent d4ee47c2
......@@ -247,7 +247,10 @@ void JobManager::slotManageCanceledJob(int id)
{
qDebug() << "################### JOB canceled: " << id;
QReadLocker locker(&m_lock);
Q_ASSERT(m_jobs.count(id) > 0);
if (m_jobs.count(id) == 0) {
// Job finished, nothing to do
return;
}
if (m_jobs[id]->m_processed) return;
m_jobs[id]->m_processed = true;
//m_jobs[id]->m_completionMutex.unlock(); // crashing on Windows
......
......@@ -212,6 +212,8 @@ bool MeltJob::startJob()
connect(this, &MeltJob::jobCanceled, [&] () {
m_showFrameEvent.reset();
m_consumer->stop();
m_successful = false;
m_done = true;
return false;
});
m_consumer->run();
......
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