Skip to content
Browse files
Fix crash when editing feature after opening a form with relation ref…
…erence widget

Also fixes a leak/performance issue - the attribute table model
for the relation reference widget is not parented to the widget,
so it is never cleaned up when the widget is deleted.
  • Loading branch information
nyalldawson authored and m-kuhn committed Aug 7, 2017
1 parent 5701b67 commit f976e8b644e786fce49dfb3b9c96e1127697d7d9
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
@@ -521,7 +521,7 @@ void QgsRelationReferenceWidget::init()
attributes << mReferencedLayer->fieldNameIndex( attr );

layerCache->setCacheSubsetOfAttributes( attributes );
mMasterModel = new QgsAttributeTableModel( layerCache );
mMasterModel = new QgsAttributeTableModel( layerCache, this );
mMasterModel->setRequest( QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry ).setSubsetOfAttributes( requestedAttrs.toList(), mReferencedLayer->fields() ) );
mFilterModel = new QgsAttributeTableFilterModel( mCanvas, mMasterModel, mMasterModel );
mFeatureListModel = new QgsFeatureListModel( mFilterModel, this );

2 comments on commit f976e8b


This comment has been minimized.

Copy link

@andreasneumann andreasneumann replied Aug 7, 2017

@nyalldawson @m-kuhn is this also relevant on master?
same question also for commit c6d8827


This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson replied Aug 8, 2017

Yes & yes - i'll forward port.

Please sign in to comment.