Skip to content

Commit 45ca0eb

Browse files
committedFeb 16, 2018
Fixes #17576 Avoid crash during node editor cleanup
1 parent 0310c1d commit 45ca0eb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎src/app/vertextool/qgsvertextool.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ void QgsVertexTool::showVertexEditor() //#spellok
984984
mVertexEditor.reset( new QgsVertexEditor( m.layer(), mSelectedFeature.get(), mCanvas ) );
985985
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mVertexEditor.get() );
986986
connect( mVertexEditor.get(), &QgsVertexEditor::deleteSelectedRequested, this, &QgsVertexTool::deleteVertexEditorSelection );
987-
connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, [ = ]( QgsFeatureId id ) { if ( mSelectedFeature.get()->featureId() == id ) cleanupVertexEditor(); } );
987+
connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, &QgsVertexTool::cleanEditor );
988988
}
989989

990990
void QgsVertexTool::cleanupVertexEditor()
@@ -2161,3 +2161,11 @@ void QgsVertexTool::stopRangeVertexSelection()
21612161
mSelectionMethod = SelectionNormal;
21622162
setHighlightedVertices( QList<Vertex>() );
21632163
}
2164+
2165+
void QgsVertexTool::cleanEditor( QgsFeatureId id )
2166+
{
2167+
if ( mSelectedFeature.get() && mSelectedFeature.get()->featureId() == id )
2168+
{
2169+
cleanupVertexEditor();
2170+
};
2171+
}

‎src/app/vertextool/qgsvertextool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class APP_EXPORT QgsVertexTool : public QgsMapToolAdvancedDigitizing
9797

9898
void startRangeVertexSelection();
9999

100+
void cleanEditor( QgsFeatureId id );
101+
100102
private:
101103

102104
void buildDragBandsForVertices( const QSet<Vertex> &movingVertices, const QgsPointXY &dragVertexMapPoint );

0 commit comments

Comments
 (0)
Please sign in to comment.