Merge pull request #54060 from elpaso/bugfix-qgis_process-deadlock

qgis_process: fix unreported deadlock
This commit is contained in:
Alessandro Pasotti 2023-08-04 16:46:20 +02:00 committed by GitHub
commit d05ddc5fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,7 +422,7 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
QVariantMap results;
try
{
if ( childAlg->flags() & QgsProcessingAlgorithm::FlagNoThreading )
if ( ( childAlg->flags() & QgsProcessingAlgorithm::FlagNoThreading ) && ( QThread::currentThread() != qApp->thread() ) )
{
// child algorithm run step must be called on main thread
auto runOnMainThread = [modelThread, &context, &modelFeedback, &results, &childAlg, &childParams]