28
28
QgsAttributeDialog::QgsAttributeDialog ( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
29
29
: QDialog( parent )
30
30
, mHighlight( 0 )
31
- , mOwnedFeature( featureOwner ? thepFeature : 0 )
32
31
{
33
32
QgsAttributeEditorContext context;
34
33
context.setDistanceArea ( myDa );
@@ -37,17 +36,22 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer* vl, QgsFeature* thepFeat
37
36
38
37
if ( !showDialogButtons )
39
38
mAttributeForm ->hideButtonBox ();
39
+
40
+ if ( featureOwner )
41
+ delete thepFeature;
40
42
}
41
43
42
44
QgsAttributeDialog::QgsAttributeDialog ( QgsVectorLayer* vl, QgsFeature* thepFeature, bool featureOwner, QWidget* parent, bool showDialogButtons, QgsAttributeEditorContext context )
43
45
: QDialog( parent )
44
46
, mHighlight( 0 )
45
- , mOwnedFeature( featureOwner ? thepFeature : 0 )
46
47
{
47
48
init ( vl, thepFeature, context, parent );
48
49
49
50
if ( !showDialogButtons )
50
51
mAttributeForm ->hideButtonBox ();
52
+
53
+ if ( featureOwner )
54
+ delete thepFeature;
51
55
}
52
56
53
57
QgsAttributeDialog::~QgsAttributeDialog ()
@@ -58,9 +62,6 @@ QgsAttributeDialog::~QgsAttributeDialog()
58
62
delete mHighlight ;
59
63
}
60
64
61
- if ( mOwnedFeature )
62
- delete mOwnedFeature ;
63
-
64
65
saveGeometry ();
65
66
}
66
67
@@ -110,7 +111,7 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, QgsAt
110
111
connect ( buttonBox, SIGNAL ( accepted () ), this , SLOT ( accept () ) );
111
112
112
113
mMenuBar = new QMenuBar ( this );
113
- QgsActionMenu* menu = new QgsActionMenu ( layer, feature, this );
114
+ QgsActionMenu* menu = new QgsActionMenu ( layer, & mAttributeForm -> feature () , this );
114
115
mMenuBar ->addMenu ( menu );
115
116
layout ()->setMenuBar ( mMenuBar );
116
117
0 commit comments