updatePartitionToCreate: avoid crash
Create the new partition before deleting the old one: otherwise the m_partition member of dlg is dangling at the time we call createPartition()
This commit is contained in:
parent
3d40527d29
commit
e482481262
@ -216,8 +216,9 @@ PartitionPage::updatePartitionToCreate( Device* device, Partition* partition )
|
||||
dlg->initFromPartitionToCreate( partition );
|
||||
if ( dlg->exec() == QDialog::Accepted )
|
||||
{
|
||||
Partition* newPartition = dlg->createPartition();
|
||||
m_core->deletePartition( device, partition );
|
||||
m_core->createPartition( device, dlg->createPartition() );
|
||||
m_core->createPartition( device, newPartition );
|
||||
}
|
||||
delete dlg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user