diff --git a/examples/qtconcurrent/imagescaling/imagescaling.cpp b/examples/qtconcurrent/imagescaling/imagescaling.cpp index 79616a1353..d674ddd085 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.cpp +++ b/examples/qtconcurrent/imagescaling/imagescaling.cpp @@ -8,7 +8,7 @@ #include -Images::Images(QWidget *parent) : QWidget(parent), downloadDialog(new DownloadDialog()) +Images::Images(QWidget *parent) : QWidget(parent), downloadDialog(new DownloadDialog(this)) { resize(800, 600); @@ -189,6 +189,7 @@ void Images::initLayout(qsizetype count) QLayoutItem *child; while ((child = imagesLayout->takeAt(0)) != nullptr) { child->widget()->setParent(nullptr); + delete child->widget(); delete child; } labels.clear();