Skip to content

Commit c52a0ba

Browse files
nyalldawsonrldhont
authored andcommittedMay 21, 2020
Don't use an event loop to wait for task starting
This is already handled in a MUCH nicer way by QgsTask::waitForFinished (mutex based, not eventloop based)
1 parent ed4a14e commit c52a0ba

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed
 

‎src/core/qgsabstractcontentcache.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,6 @@ class CORE_EXPORT QgsAbstractContentCache : public QgsAbstractContentCacheBase
458458
*/
459459
bool waitForTaskFinished( QgsNetworkContentFetcherTask *task ) const
460460
{
461-
// First step, waiting for task running
462-
if ( task->status() != QgsTask::Running )
463-
{
464-
QEventLoop loop;
465-
connect( task, &QgsNetworkContentFetcherTask::begun, &loop, &QEventLoop::quit );
466-
if ( task->status() != QgsTask::Running )
467-
loop.exec();
468-
}
469-
470461
// Second step, wait 5 seconds for task finished
471462
if ( task->waitForFinished( 5000 ) )
472463
{

0 commit comments

Comments
 (0)
Please sign in to comment.