Skip to content

Commit

Permalink
Cleanup of validation objects and markers
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Apr 6, 2017
1 parent 9619d5e commit 80cef51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/nodetool/qgsnodetool2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ void QgsNodeTool2::deactivate()
setHighlightedNodes( QList<Vertex>() );
removeTemporaryRubberBands();
cleanupNodeEditor();

QHash< QPair<QgsVectorLayer *, QgsFeatureId>, GeometryValidation>::iterator it = mValidations.begin();
for ( ; it != mValidations.end(); ++it )
it->cleanup();
mValidations.clear();

QgsMapToolAdvancedDigitizing::deactivate();
}

Expand Down Expand Up @@ -1701,6 +1707,13 @@ void QgsNodeTool2::validationFinished()
{
QStatusBar *sb = QgisApp::instance()->statusBar();
sb->showMessage( tr( "Validation finished (%n error(s) found).", "number of geometry errors", validation.errorMarkers.size() ) );
if ( validation.errorMarkers.isEmpty() )
{
// not needed anymore (no markers to keep displayed)
validation.cleanup();
mValidations.remove( it.key() );
}
break;
}
}
}
Expand Down

0 comments on commit 80cef51

Please sign in to comment.