Skip to content

Commit

Permalink
Silence false positive clang warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 13, 2022
1 parent baf9cc4 commit 824cc42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/expression/qgsexpressionutils.cpp
Expand Up @@ -82,10 +82,12 @@ QgsMapLayer *QgsExpressionUtils::getMapLayer( const QVariant &value, const QgsEx
ml = project->mapLayersByName( value.toString() ).value( 0 );
};

#ifndef __clang_analyzer__
if ( QThread::currentThread() == qApp->thread() )
getMapLayerFromProjectInstance();
else
QMetaObject::invokeMethod( qApp, getMapLayerFromProjectInstance, Qt::BlockingQueuedConnection );
#endif

return ml;
}
Expand All @@ -105,10 +107,12 @@ QVariant QgsExpressionUtils::runMapLayerFunctionThreadSafe( const QVariant &valu
// Anything else risks a crash.

// Note that this is not completely correct -- a layer may have been created on a non-main thread!
#ifndef __clang_analyzer__
if ( QThread::currentThread() == qApp->thread() )
runFunction();
else
QMetaObject::invokeMethod( qApp, runFunction, Qt::BlockingQueuedConnection );
#endif

return res;
}
Expand Down

0 comments on commit 824cc42

Please sign in to comment.