File tree Expand file tree Collapse file tree 3 files changed +8
-19
lines changed Expand file tree Collapse file tree 3 files changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,6 @@ void QgsMapRendererCustomPainterJob::start()
84
84
}
85
85
86
86
mLayerJobs = prepareJobs ( mPainter , mLabelingEngineV2 );
87
- // prepareJobs calls mapLayer->createMapRenderer may involve cloning a RasterDataProvider,
88
- // whose constructor may need to download some data (i.e. WMS, AMS) and doing so runs a
89
- // QEventLoop waiting for the network request to complete. If unluckily someone calls
90
- // mapCanvas->refresh() while this is happening, QgsMapRendererCustomPainterJob::cancel is
91
- // called, deleting the QgsMapRendererCustomPainterJob while this function is running.
92
- // Hence we need to check whether the job is still active before proceeding
93
- if ( !isActive () )
94
- return ;
95
87
96
88
QgsDebugMsg ( " Rendering prepared in (seconds): " + QString ( " %1" ).arg ( prepareTime.elapsed () / 1000.0 ) );
97
89
Original file line number Diff line number Diff line change @@ -62,14 +62,6 @@ void QgsMapRendererParallelJob::start()
62
62
}
63
63
64
64
mLayerJobs = prepareJobs ( nullptr , mLabelingEngineV2 );
65
- // prepareJobs calls mapLayer->createMapRenderer may involve cloning a RasterDataProvider,
66
- // whose constructor may need to download some data (i.e. WMS, AMS) and doing so runs a
67
- // QEventLoop waiting for the network request to complete. If unluckily someone calls
68
- // mapCanvas->refresh() while this is happening, QgsMapRendererCustomPainterJob::cancel is
69
- // called, deleting the QgsMapRendererCustomPainterJob while this function is running.
70
- // Hence we need to check whether the job is still active before proceeding
71
- if ( !isActive () )
72
- return ;
73
65
74
66
QgsDebugMsg ( QString ( " QThreadPool max thread count is %1" ).arg ( QThreadPool::globalInstance ()->maxThreadCount () ) );
75
67
Original file line number Diff line number Diff line change @@ -575,9 +575,6 @@ void QgsMapCanvas::refreshMap()
575
575
576
576
stopRendering (); // if any...
577
577
578
- // from now on we can accept refresh requests again
579
- mRefreshScheduled = false ;
580
-
581
578
// build the expression context
582
579
QgsExpressionContext expressionContext;
583
580
expressionContext << QgsExpressionContextUtils::globalScope ()
@@ -610,6 +607,14 @@ void QgsMapCanvas::refreshMap()
610
607
611
608
mJob ->start ();
612
609
610
+ // from now on we can accept refresh requests again
611
+ // this must be reset only after the job has been started, because
612
+ // some providers (yes, it's you WCS and AMS!) during preparation
613
+ // do network requests and start an internal event loop, which may
614
+ // end up calling refresh() and would schedule another refresh,
615
+ // deleting the one we have just started.
616
+ mRefreshScheduled = false ;
617
+
613
618
mMapUpdateTimer .start ();
614
619
615
620
emit renderStarting ();
You can’t perform that action at this time.
0 commit comments