@@ -85,7 +85,7 @@ void QgsGeometryValidationService::onLayersAdded( const QList<QgsMapLayer *> &la
8585 {
8686 cleanupLayerChecks ( vectorLayer );
8787 mLayerChecks .remove ( vectorLayer );
88- });
88+ } );
8989
9090 enableLayerChecks ( vectorLayer );
9191 }
@@ -141,7 +141,7 @@ void QgsGeometryValidationService::onBeforeCommitChanges( QgsVectorLayer *layer
141141 }
142142}
143143
144- void QgsGeometryValidationService::cleanupLayerChecks (QgsVectorLayer* layer)
144+ void QgsGeometryValidationService::cleanupLayerChecks ( QgsVectorLayer * layer )
145145{
146146 if ( !mLayerChecks .contains ( layer ) )
147147 return ;
@@ -174,7 +174,10 @@ void QgsGeometryValidationService::enableLayerChecks( QgsVectorLayer *layer )
174174 return ;
175175 }
176176
177- checkInformation.context = new QgsGeometryCheckContext ( log10 ( layer->geometryOptions ()->geometryPrecision () ) * -1 , mProject ->crs (), mProject ->transformContext () );
177+ int precision = log10 ( layer->geometryOptions ()->geometryPrecision () ) * -1 ;
178+ if ( precision == 0 )
179+ precision = 8 ;
180+ checkInformation.context = qgis::make_unique<QgsGeometryCheckContext>( precision, mProject ->crs (), mProject ->transformContext () );
178181
179182 QList<QgsGeometryCheck *> layerChecks;
180183
@@ -355,7 +358,8 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
355358 {
356359 sharedErrors.append ( std::shared_ptr<QgsGeometryCheckError>( error ) );
357360 }
358- allErrors.append (sharedErrors);
361+
362+ allErrors.append ( sharedErrors );
359363 if ( !feedback->isCanceled () )
360364 emit topologyChecksUpdated ( layer, sharedErrors );
361365
0 commit comments