From 90d26bfd314957b672c9abdfc83759e992f5d821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Jul 2014 16:46:33 +0200 Subject: [PATCH] Safer dialog handling --- src/modules/partition/PartitionPage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/partition/PartitionPage.cpp b/src/modules/partition/PartitionPage.cpp index a71e265ac..db4d211e6 100644 --- a/src/modules/partition/PartitionPage.cpp +++ b/src/modules/partition/PartitionPage.cpp @@ -29,6 +29,7 @@ // Qt #include #include +#include PartitionPage::PartitionPage( QWidget* parent ) : Calamares::AbstractPage( parent ) @@ -93,10 +94,10 @@ void PartitionPage::onCreateClicked() Partition* partition = model->partitionForIndex( index ); Q_ASSERT( partition ); - CreatePartitionDialog dlg( model->device(), partition, this ); - if ( !dlg.exec() ) + QPointer dlg = new CreatePartitionDialog( model->device(), partition, this ); + if ( dlg->exec() == QDialog::Accepted ) { - return; + m_core->createPartition( dlg->createJob() ); } - m_core->createPartition( dlg.createJob() ); + delete dlg; }