From 464b417d24ea5cc755d67a09ce3405b99a6e3ccd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Jun 2020 07:08:43 -0400 Subject: [PATCH] CAboutDialog: Make use of unique_ptr --- src/Editor/CAboutDialog.cpp | 7 ++----- src/Editor/CAboutDialog.h | 8 +++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Editor/CAboutDialog.cpp b/src/Editor/CAboutDialog.cpp index 1d339fdd..c7677e68 100644 --- a/src/Editor/CAboutDialog.cpp +++ b/src/Editor/CAboutDialog.cpp @@ -4,7 +4,7 @@ CAboutDialog::CAboutDialog(QWidget *parent) : QDialog(parent), - ui(new Ui::CAboutDialog) + ui(std::make_unique()) { ui->setupUi(this); @@ -13,7 +13,4 @@ CAboutDialog::CAboutDialog(QWidget *parent) : ui->AboutLabel->setText(LabelText); } -CAboutDialog::~CAboutDialog() -{ - delete ui; -} +CAboutDialog::~CAboutDialog() = default; diff --git a/src/Editor/CAboutDialog.h b/src/Editor/CAboutDialog.h index 8d778270..02f8588a 100644 --- a/src/Editor/CAboutDialog.h +++ b/src/Editor/CAboutDialog.h @@ -3,6 +3,8 @@ #include +#include + namespace Ui { class CAboutDialog; } @@ -12,11 +14,11 @@ class CAboutDialog : public QDialog Q_OBJECT public: - explicit CAboutDialog(QWidget *parent = 0); - ~CAboutDialog(); + explicit CAboutDialog(QWidget *parent = nullptr); + ~CAboutDialog() override; private: - Ui::CAboutDialog *ui; + std::unique_ptr ui; }; #endif // CABOUTDIALOG_H