forked from qt-creator/qt-creator
Valgrind: Fix memory leak
Detected by valgrind :) Change-Id: I4e6b9cb1980cce82170e3f6c2e7cb541dd838d5e Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
a4a4f7a475
commit
1b461bead2
@@ -159,9 +159,12 @@ ValgrindConfigWidget::ValgrindConfigWidget(ValgrindBaseSettings *settings,
|
|||||||
if (!global) {
|
if (!global) {
|
||||||
// In project settings we want a flat vertical list.
|
// In project settings we want a flat vertical list.
|
||||||
QVBoxLayout *l = new QVBoxLayout;
|
QVBoxLayout *l = new QVBoxLayout;
|
||||||
while (layout()->count())
|
while (layout()->count()) {
|
||||||
if (QWidget *w = layout()->takeAt(0)->widget())
|
QLayoutItem *item = layout()->takeAt(0);
|
||||||
|
if (QWidget *w = item->widget())
|
||||||
l->addWidget(w);
|
l->addWidget(w);
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
delete layout();
|
delete layout();
|
||||||
setLayout(l);
|
setLayout(l);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user