Skip to content

Commit f976e8b

Browse files
nyalldawsonm-kuhn
authored andcommittedAug 7, 2017
Fix crash when editing feature after opening a form with relation reference 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.
1 parent 5701b67 commit f976e8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ void QgsRelationReferenceWidget::init()
521521
attributes << mReferencedLayer->fieldNameIndex( attr );
522522

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

2 commit comments

Comments
 (2)

andreasneumann commented on Aug 7, 2017

@andreasneumann
Member

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

nyalldawson commented on Aug 8, 2017

@nyalldawson
CollaboratorAuthor

Yes & yes - i'll forward port.

Please sign in to comment.