Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
QgsVectorLayerRenderer::drawRendererV2(): make it cancellable in all …
…situations

Currently the mContext.renderingStopped() check is done only if the feature
has a geometry. Which makes it possible to have really really long loops if
a long series of features without geometries are returned by the feature iterator.
This is perhaps not something that can happen in practice, but I hit that issue
when prototyping my WFS asynchronous feature downloading that currently only returns
dummy features. QGIS was completely blocked due to the iterator returning infinite
geometry-less features.
  • Loading branch information
rouault committed Mar 7, 2016
1 parent b1b7b65 commit b1f5b5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsvectorlayerrenderer.cpp
Expand Up @@ -295,15 +295,15 @@ void QgsVectorLayerRenderer::drawRendererV2( QgsFeatureIterator& fit )
{
try
{
if ( !fet.constGeometry() )
continue; // skip features without geometry

if ( mContext.renderingStopped() )
{
QgsDebugMsg( QString( "Drawing of vector layer %1 cancelled." ).arg( layerID() ) );
break;
}

if ( !fet.constGeometry() )
continue; // skip features without geometry

mContext.expressionContext().setFeature( fet );

bool sel = mContext.showSelection() && mSelectedFeatureIds.contains( fet.id() );
Expand Down

0 comments on commit b1f5b5f

Please sign in to comment.