Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8228 from pblottiere/server_deadlock
[server] Fixes freeze of server during rendering
  • Loading branch information
pblottiere committed Oct 22, 2018
2 parents 4fa62e9 + ef4bf1a commit dfb28fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server/services/wms/qgsmaprendererjobproxy.cpp
Expand Up @@ -56,6 +56,13 @@ namespace QgsWms
renderJob.setFeatureFilterProvider( mFeatureFilterProvider );
#endif
renderJob.start();

// Allows the main thread to manage blocking call coming from rendering
// threads (see discussion in https://issues.qgis.org/issues/18988).
QEventLoop loop;
QObject::connect( &renderJob, &QgsMapRendererParallelJob::finished, &loop, &QEventLoop::quit );
loop.exec();

renderJob.waitForFinished();
*image = renderJob.renderedImage();
mPainter.reset( new QPainter( image ) );
Expand Down

0 comments on commit dfb28fe

Please sign in to comment.