Skip to content

Commit 09ee755

Browse files
committed
One feature pool per layer is enough
1 parent 6df73d6 commit 09ee755

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/app/qgsgeometryvalidationservice.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,13 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
259259
QgsFeatureIds affectedFeatureIds = layer->editBuffer()->changedGeometries().keys().toSet();
260260
affectedFeatureIds.unite( layer->editBuffer()->addedFeatures().keys().toSet() );
261261

262-
// TODO: ownership of these objects...
263-
QgsVectorLayerFeaturePool *featurePool = new QgsVectorLayerFeaturePool( layer );
262+
QgsFeaturePool *featurePool = mFeaturePools.value( layer->id() );
263+
if ( !featurePool )
264+
{
265+
featurePool = new QgsVectorLayerFeaturePool( layer );
266+
mFeaturePools.insert( layer->id(), featurePool );
267+
}
268+
264269
QList<QgsGeometryCheckError *> &allErrors = mLayerChecks[layer].topologyCheckErrors;
265270
QMap<QString, QgsFeatureIds> layerIds;
266271

@@ -279,11 +284,6 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
279284
layerIds.insert( layer->id(), checkFeatureIds );
280285
QgsGeometryCheck::LayerFeatureIds layerFeatureIds( layerIds );
281286

282-
if ( !mFeaturePools.contains( layer->id() ) )
283-
{
284-
mFeaturePools.insert( layer->id(), featurePool );
285-
}
286-
287287
const QList<QgsGeometryCheck *> checks = mLayerChecks[layer].topologyChecks;
288288

289289
QMap<const QgsGeometryCheck *, QgsFeedback *> feedbacks;

0 commit comments

Comments
 (0)