Skip to content

Commit 34e6a61

Browse files
committed
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. (forward port from f976e8b)
1 parent 47ab1a7 commit 34e6a61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/editorwidgets/qgsrelationreferencewidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void QgsRelationReferenceWidget::init()
543543
attributes << mReferencedLayer->fields().lookupField( attr );
544544

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

0 commit comments

Comments
 (0)