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 @@ -98,14 +98,6 @@ void QgsMapRendererCustomPainterJob::start()
98
98
}
99
99
100
100
mLayerJobs = prepareJobs ( mPainter , mLabelingEngine , mLabelingEngineV2 );
101
- // prepareJobs calls mapLayer->createMapRenderer may involve cloning a RasterDataProvider,
102
- // whose constructor may need to download some data (i.e. WMS, AMS) and doing so runs a
103
- // QEventLoop waiting for the network request to complete. If unluckily someone calls
104
- // mapCanvas->refresh() while this is happening, QgsMapRendererCustomPainterJob::cancel is
105
- // called, deleting the QgsMapRendererCustomPainterJob while this function is running.
106
- // Hence we need to check whether the job is still active before proceeding
107
- if ( !isActive () )
108
- return ;
109
101
110
102
QgsDebugMsg ( " Rendering prepared in (seconds): " + QString ( " %1" ).arg ( prepareTime.elapsed () / 1000.0 ) );
111
103
Original file line number Diff line number Diff line change @@ -76,14 +76,6 @@ void QgsMapRendererParallelJob::start()
76
76
}
77
77
78
78
mLayerJobs = prepareJobs ( nullptr , mLabelingEngine , mLabelingEngineV2 );
79
- // prepareJobs calls mapLayer->createMapRenderer may involve cloning a RasterDataProvider,
80
- // whose constructor may need to download some data (i.e. WMS, AMS) and doing so runs a
81
- // QEventLoop waiting for the network request to complete. If unluckily someone calls
82
- // mapCanvas->refresh() while this is happening, QgsMapRendererCustomPainterJob::cancel is
83
- // called, deleting the QgsMapRendererCustomPainterJob while this function is running.
84
- // Hence we need to check whether the job is still active before proceeding
85
- if ( !isActive () )
86
- return ;
87
79
88
80
QgsDebugMsg ( QString ( " QThreadPool max thread count is %1" ).arg ( QThreadPool::globalInstance ()->maxThreadCount () ) );
89
81
Original file line number Diff line number Diff line change @@ -706,9 +706,6 @@ void QgsMapCanvas::refreshMap()
706
706
707
707
stopRendering (); // if any...
708
708
709
- // from now on we can accept refresh requests again
710
- mRefreshScheduled = false ;
711
-
712
709
// build the expression context
713
710
QgsExpressionContext expressionContext;
714
711
expressionContext << QgsExpressionContextUtils::globalScope ()
@@ -741,6 +738,14 @@ void QgsMapCanvas::refreshMap()
741
738
742
739
mJob ->start ();
743
740
741
+ // from now on we can accept refresh requests again
742
+ // this must be reset only after the job has been started, because
743
+ // some providers (yes, it's you WCS and AMS!) during preparation
744
+ // do network requests and start an internal event loop, which may
745
+ // end up calling refresh() and would schedule another refresh,
746
+ // deleting the one we have just started.
747
+ mRefreshScheduled = false ;
748
+
744
749
mMapUpdateTimer .start ();
745
750
746
751
emit renderStarting ();
You can’t perform that action at this time.
0 commit comments