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.

(forward port from f976e8b)
  • Loading branch information
nyalldawson committed Aug 8, 2017
1 parent 47ab1a7 commit 34e6a6126c97caceddae6b9c1d8ea9128cc951b5
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/editorwidgets/qgsrelationreferencewidget.cpp
@@ -543,7 +543,7 @@ void QgsRelationReferenceWidget::init()
attributes << mReferencedLayer->fields().lookupField( attr );

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

0 comments on commit 34e6a61

Please sign in to comment.