Skip to content
Permalink
Browse files

Fix crash when loading WCS layers (fixes #15595)

The problem is that some providers would still issue network
requests in prepareJobs() - this should be ideally avoided,
because it is run in main thread - all the work should be deferred
to be done in worker thread.

(cherry picked from commit 08f4a0f)
  • Loading branch information
wonder-sk committed Oct 28, 2016
1 parent f365206 commit 66a213bc5aa9fa22affc512c31b80594ce6d3ffa
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/gui/qgsmapcanvas.cpp
@@ -663,9 +663,6 @@ void QgsMapCanvas::refreshMap()

stopRendering(); // if any...

// from now on we can accept refresh requests again
mRefreshScheduled = false;

//build the expression context
QgsExpressionContext expressionContext;
expressionContext << QgsExpressionContextUtils::globalScope()
@@ -698,6 +695,14 @@ void QgsMapCanvas::refreshMap()

mJob->start();

// from now on we can accept refresh requests again
// this must be reset only after the job has been started, because
// some providers (yes, it's you WCS and AMS!) during preparation
// do network requests and start an internal event loop, which may
// end up calling refresh() and would schedule another refresh,
// deleting the one we have just started.
mRefreshScheduled = false;

mMapUpdateTimer.start();

emit renderStarting();

0 comments on commit 66a213b

Please sign in to comment.
You can’t perform that action at this time.