Skip to content

Commit

Permalink
Fix crash when de/reactivating layer checks
Browse files Browse the repository at this point in the history
When errors have been found and shown on the dock and deactivating layer checks that resulted in crashes.
Also when deactivating and reactivating checks, that would result in crashes.
  • Loading branch information
m-kuhn committed Nov 2, 2018
1 parent 5bc588e commit 7fb8579
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -180,9 +180,12 @@ void QgsGeometryValidationService::cleanupLayerChecks( QgsVectorLayer *layer )
VectorLayerCheckInformation &checkInformation = mLayerChecks[layer];

cancelTopologyCheck( layer );
clearTopologyChecks( layer );

qDeleteAll( checkInformation.singleFeatureChecks );
checkInformation.singleFeatureChecks.clear();
qDeleteAll( checkInformation.topologyChecks );
checkInformation.topologyChecks.clear();
checkInformation.context.reset();
}

Expand Down Expand Up @@ -320,6 +323,7 @@ void QgsGeometryValidationService::clearTopologyChecks( QgsVectorLayer *layer )
{
QList<std::shared_ptr<QgsGeometryCheckError>> &allErrors = mLayerChecks[layer].topologyCheckErrors;
allErrors.clear();
layer->setAllowCommit( mLayerChecks[layer].singleFeatureCheckErrors.empty() );

emit topologyChecksCleared( layer );
}
Expand Down Expand Up @@ -368,6 +372,7 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
{
cancelTopologyCheck( layer );
clearTopologyChecks( layer );
layer->setAllowCommit( false );

QgsFeatureIds affectedFeatureIds;
if ( layer->editBuffer() )
Expand Down

0 comments on commit 7fb8579

Please sign in to comment.