From cd7bf11ba9885d974f94c0ae57709b99c63b92c2 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 23 Feb 2020 03:19:18 -0600 Subject: Qt UI: Fix small memory leaks --- ui/qt5/bootpage.cc | 4 ++-- ui/qt5/partitionpage.cc | 1 + ui/qt5/pkgdefaults.cc | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'ui') diff --git a/ui/qt5/bootpage.cc b/ui/qt5/bootpage.cc index 09bebbf..baa9c67 100644 --- a/ui/qt5/bootpage.cc +++ b/ui/qt5/bootpage.cc @@ -3,7 +3,7 @@ * horizon-qt5, the Qt 5 user interface for * Project Horizon * - * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * Copyright (c) 2019-2020 Adélie Linux and contributors. All rights reserved. * This code is licensed under the AGPL 3.0 license, as noted in the * LICENSE-code file in the root directory of this repository. * @@ -34,7 +34,7 @@ BootPage::BootPage(QWidget *parent) : HorizonWizardPage(parent) { yesGrub->setWhatsThis(tr("This option will install a bootloader to your hard disk, replacing any other bootloader if present.")); noGrub = new QRadioButton(tr("&Do not install a boot loader.")); noGrub->setWhatsThis(tr("This option will not install a bootloader to your hard disk. You may be required to configure a bootloader yourself before your computer will start up properly.")); - QButtonGroup *grubChoices = new QButtonGroup; + QButtonGroup *grubChoices = new QButtonGroup(this); grubChoices->addButton(yesGrub, true); grubChoices->addButton(noGrub, false); connect(grubChoices, static_cast(&QButtonGroup::buttonClicked), diff --git a/ui/qt5/partitionpage.cc b/ui/qt5/partitionpage.cc index 1d259b1..a74b1a9 100644 --- a/ui/qt5/partitionpage.cc +++ b/ui/qt5/partitionpage.cc @@ -73,6 +73,7 @@ void PartitionPage::scanDisks() { } thread = new PartitionProbeThread; + thread->setParent(this); connect(thread, &PartitionProbeThread::foundDisks, this, &PartitionPage::processDisks); thread->start(); diff --git a/ui/qt5/pkgdefaults.cc b/ui/qt5/pkgdefaults.cc index e3c358d..34be52c 100644 --- a/ui/qt5/pkgdefaults.cc +++ b/ui/qt5/pkgdefaults.cc @@ -3,7 +3,7 @@ * horizon-qt5, the Qt 5 user interface for * Project Horizon * - * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * Copyright (c) 2019-2020 Adélie Linux and contributors. All rights reserved. * This code is licensed under the AGPL 3.0 license, as noted in the * LICENSE-code file in the root directory of this repository. * @@ -34,7 +34,7 @@ PkgDefaultsPage::PkgDefaultsPage(QWidget *parent) : HorizonWizardPage(parent) { /******************** /bin/sh provider ********************/ - QButtonGroup *shellGroup = new QButtonGroup; + QButtonGroup *shellGroup = new QButtonGroup(this); QLabel *shellLabel = new QLabel(tr("Shell to use for /bin/sh:")); shellLabel->setWordWrap(true); @@ -66,7 +66,7 @@ PkgDefaultsPage::PkgDefaultsPage(QWidget *parent) : HorizonWizardPage(parent) { /******************** /sbin/init provider ********************/ - QButtonGroup *initGroup = new QButtonGroup; + QButtonGroup *initGroup = new QButtonGroup(this); QLabel *initLabel = new QLabel(tr("Init system (/sbin/init):")); initLabel->setWordWrap(true); @@ -93,7 +93,7 @@ PkgDefaultsPage::PkgDefaultsPage(QWidget *parent) : HorizonWizardPage(parent) { /******************** device event handler ********************/ - QButtonGroup *udevGroup = new QButtonGroup; + QButtonGroup *udevGroup = new QButtonGroup(this); QLabel *udevLabel = new QLabel(tr("uevent management daemon:")); udevLabel->setWordWrap(true); -- cgit v1.2.3-60-g2f50