- Timestamp:
- Oct 25, 2021 1:25:10 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r92024 r92032 132 132 m_strMachineBaseName, 133 133 groups, strTypeId, QString()); 134 /* Try to delete the hard disk: */ 135 deleteVirtualDisk(); 136 134 137 if (!vbox.isOk()) 135 138 { … … 164 167 if (!vbox.isOk()) 165 168 { 169 /* Try to delete the hard disk: */ 170 deleteVirtualDisk(); 166 171 msgCenter().cannotRegisterMachine(vbox, m_machine.GetName(), this); 167 172 return false; … … 441 446 CVirtualBox vbox = uiCommon().virtualBox(); 442 447 /* Unregister on failure */ 443 QVector<CMedium> aMedia = m_machine.Unregister(KCleanupMode_ UnregisterOnly); /// @todo replace with DetachAllReturnHardDisksOnly once a progress dialog is in place below448 QVector<CMedium> aMedia = m_machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly); 444 449 if (vbox.isOk()) 445 450 { … … 447 452 progress.WaitForCompletion(-1); /// @todo do this nicely with a progress dialog, this can delete lots of files 448 453 } 449 return false;450 } 451 452 /* Ensure we don't try to delete a newly created virtual hard drive on success:*/454 } 455 456 /* Make sure we detach CMedium wrapper from IMedium pointer to avoid deletion of IMedium as m_virtualDisk is deallocated: */ 457 /* Or in case of IMachine::DeleteConfig IMedium has been already deleted so detach in this case as well:*/ 453 458 if (!m_virtualDisk.isNull()) 454 459 m_virtualDisk.detach(); 455 460 456 return true;461 return success; 457 462 } 458 463 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r91593 r92032 79 79 bool createVM(); 80 80 bool createVirtualDisk(); 81 void deleteVirtualDisk();82 81 83 82 CMedium &virtualDisk(); … … 189 188 /** Returns the Id of newly created VM. */ 190 189 QUuid createdMachineId() const; 190 void deleteVirtualDisk(); 191 191 192 192 /** @name Variables -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r91616 r92032 640 640 } 641 641 642 fResult = pWizard->createVM(); 643 /* Try to delete the hard disk: */ 644 if (!fResult) 645 pWizard->deleteVirtualDisk(); 646 647 return fResult; 642 return pWizard->createVM(); 648 643 } 649 644 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp
r91294 r92032 509 509 } 510 510 511 fResult = pWizard->createVM(); 512 /* Try to delete the hard disk: */ 513 if (!fResult) 514 pWizard->deleteVirtualDisk(); 515 516 return fResult; 511 return pWizard->createVM(); 517 512 } 518 513
Note:
See TracChangeset
for help on using the changeset viewer.