Skip to content

Commit 80cef51

Browse files
committed
Cleanup of validation objects and markers
1 parent 9619d5e commit 80cef51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/app/nodetool/qgsnodetool2.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ void QgsNodeTool2::deactivate()
258258
setHighlightedNodes( QList<Vertex>() );
259259
removeTemporaryRubberBands();
260260
cleanupNodeEditor();
261+
262+
QHash< QPair<QgsVectorLayer *, QgsFeatureId>, GeometryValidation>::iterator it = mValidations.begin();
263+
for ( ; it != mValidations.end(); ++it )
264+
it->cleanup();
265+
mValidations.clear();
266+
261267
QgsMapToolAdvancedDigitizing::deactivate();
262268
}
263269

@@ -1701,6 +1707,13 @@ void QgsNodeTool2::validationFinished()
17011707
{
17021708
QStatusBar *sb = QgisApp::instance()->statusBar();
17031709
sb->showMessage( tr( "Validation finished (%n error(s) found).", "number of geometry errors", validation.errorMarkers.size() ) );
1710+
if ( validation.errorMarkers.isEmpty() )
1711+
{
1712+
// not needed anymore (no markers to keep displayed)
1713+
validation.cleanup();
1714+
mValidations.remove( it.key() );
1715+
}
1716+
break;
17041717
}
17051718
}
17061719
}

0 commit comments

Comments
 (0)