[node editor] fix crash when editor is open and feature deleted

This commit is contained in:
nirvn 2017-11-23 13:52:28 +07:00 committed by Martin Dobias
parent 248bc5db03
commit 134065dae5

View File

@ -965,6 +965,7 @@ void QgsNodeTool::showNodeEditor()
mNodeEditor.reset( new QgsNodeEditor( m.layer(), mSelectedFeature.get(), mCanvas ) );
QgisApp::instance()->addDockWidget( Qt::LeftDockWidgetArea, mNodeEditor.get() );
connect( mNodeEditor.get(), &QgsNodeEditor::deleteSelectedRequested, this, &QgsNodeTool::deleteNodeEditorSelection );
connect( mSelectedFeature.get()->vlayer(), &QgsVectorLayer::featureDeleted, this, [ = ]( QgsFeatureId id ) { if ( mSelectedFeature.get()->featureId() == id ) cleanupNodeEditor(); } );
}
void QgsNodeTool::cleanupNodeEditor()