Commit 1b461bea authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Valgrind: Fix memory leak

Detected by valgrind :)

Change-Id: I4e6b9cb1980cce82170e3f6c2e7cb541dd838d5e
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent a4a4f7a4
......@@ -159,9 +159,12 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
if (!global) {
// In project settings we want a flat vertical list.
QVBoxLayout *l = new QVBoxLayout;
while (layout()->count())
if (QWidget *w = layout()->takeAt(0)->widget())
while (layout()->count()) {
QLayoutItem *item = layout()->takeAt(0);
if (QWidget *w = item->widget())
l->addWidget(w);
delete item;
}
delete layout();
setLayout(l);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment