Skip to content
Browse files

QgsVectorLayerRenderer::drawRendererV2(): make it cancellable in all …


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 b1f5b5fd513fe7d791a1c0dcdb71c6aeb7e058e6
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/qgsvectorlayerrenderer.cpp
@@ -295,15 +295,15 @@ void QgsVectorLayerRenderer::drawRendererV2( QgsFeatureIterator& fit )
if ( !fet.constGeometry() )
continue; // skip features without geometry

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

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

mContext.expressionContext().setFeature( fet );

bool sel = mContext.showSelection() && mSelectedFeatureIds.contains( );

0 comments on commit b1f5b5f

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