Skip to content

Commit aa46df2

Browse files
committedOct 21, 2014
Fix one memory leak + add note to show() calls as they will delete the dialog
1 parent 93864ce commit aa46df2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/app/qgsfeatureaction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bool QgsFeatureAction::viewFeatureForm( QgsHighlight *h )
9797

9898
QgsAttributeDialog *dialog = newDialog( true );
9999
dialog->setHighlight( h );
100-
dialog->show();
100+
dialog->show(); // will also delete the dialog on close (show() is overridden)
101101

102102
return true;
103103
}
@@ -122,7 +122,7 @@ bool QgsFeatureAction::editFeature( bool showModal )
122122
}
123123
else
124124
{
125-
dialog->show();
125+
dialog->show(); // will also delete the dialog on close (show() is overridden)
126126
}
127127

128128
return true;
@@ -196,11 +196,12 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
196196

197197
if ( showModal )
198198
{
199+
dialog->setAttribute( Qt::WA_DeleteOnClose );
199200
dialog->exec();
200201
}
201202
else
202203
{
203-
dialog->show();
204+
dialog->show(); // will also delete the dialog on close (show() is overridden)
204205
return true;
205206
}
206207
}

0 commit comments

Comments
 (0)
Please sign in to comment.