Skip to content
Permalink
Browse files

attribute dialog: really keep cloned feature until destruction (featu…

…re action

also need it and crash otherwise)

This reverts revert commit f618cae.
  • Loading branch information
jef-n committed Oct 30, 2014
1 parent a0b5241 commit 23f39a231386eddaa5ec4932f313af9f0d782cf8
Showing with 6 additions and 6 deletions.
  1. +5 −6 src/gui/qgsattributedialog.cpp
  2. +1 −0 src/gui/qgsattributedialog.h
@@ -28,6 +28,7 @@
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
: QDialog( parent )
, mHighlight( 0 )
, mOwnedFeature( featureOwner ? thepFeature : 0 )
{
QgsAttributeEditorContext context;
context.setDistanceArea( myDa );
@@ -36,22 +37,17 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat

if ( !showDialogButtons )
mAttributeForm->hideButtonBox();

if ( featureOwner )
delete thepFeature;
}

QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QWidget* parent, bool showDialogButtons, QgsAttributeEditorContext context )
: QDialog( parent )
, mHighlight( 0 )
, mOwnedFeature( featureOwner ? thepFeature : 0 )
{
init( vl, thepFeature, context, parent );

if ( !showDialogButtons )
mAttributeForm->hideButtonBox();

if ( featureOwner )
delete thepFeature;
}

QgsAttributeDialog::~QgsAttributeDialog()
@@ -62,6 +58,9 @@ QgsAttributeDialog::~QgsAttributeDialog()
delete mHighlight;
}

if( mOwnedFeature )
delete mOwnedFeature;

saveGeometry();
}

@@ -136,6 +136,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
QString mReturnvarname;
QgsAttributeForm* mAttributeForm;
QMenuBar* mMenuBar;
QgsFeature *mOwnedFeature;

// true if this dialog is editable
bool mEditable;

0 comments on commit 23f39a2

Please sign in to comment.
You can’t perform that action at this time.