Commit a1af4b70 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix freeze trying to change profile while load tasks were running

parent fcede166
Pipeline #120097 passed with stage
in 8 minutes and 11 seconds
......@@ -640,6 +640,10 @@ void ClipLoadTask::run()
}
generateThumbnail(binClip, producer);
emit taskDone();
} else {
// Might be aborted by profile switch
abort();
return;
}
pCore->taskManager.taskDone(m_owner.second, this);
}
......@@ -654,7 +658,7 @@ void ClipLoadTask::abort()
auto binClip = pCore->projectItemModel()->getClipByBinID(QString::number(m_owner.second));
if (binClip) {
QMetaObject::invokeMethod(binClip.get(), "setInvalid", Qt::QueuedConnection);
if (binClip->hash().isEmpty()) {
if (binClip->isValid() && binClip->hash().isEmpty()) {
// User tried to add an invalid clip, remove it.
pCore->projectItemModel()->requestBinClipDeletion(binClip, undo, redo);
} else {
......
Supports Markdown
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