From b9e8cab1e55eeb01ed8c56ed0829526dfe46ae50 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 9 May 2017 13:15:01 +0800 Subject: [PATCH] Revise class memebers construction & destruction Use nullptr Delete m_contentDelegate on close Remove redundant deletion of m_contentModel since parent is setup correctly --- src/gui/addnewtorrentdialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index b87d4010a..5bbac7bb4 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -78,8 +78,8 @@ namespace AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inParams, QWidget *parent) : QDialog(parent) , ui(new Ui::AddNewTorrentDialog) - , m_contentModel(0) - , m_contentDelegate(0) + , m_contentModel(nullptr) + , m_contentDelegate(nullptr) , m_hasMetadata(false) , m_oldIndex(0) , m_torrentParams(inParams) @@ -148,9 +148,9 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP AddNewTorrentDialog::~AddNewTorrentDialog() { saveState(); + + delete m_contentDelegate; delete ui; - if (m_contentModel) - delete m_contentModel; } bool AddNewTorrentDialog::isEnabled()