VirtualBox

Changeset 52993 in vbox for trunk


Ignore:
Timestamp:
Oct 8, 2014 12:40:02 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Prevent crash on VM shutdown/power-off while take-snapshot dialog opened.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r52978 r52993  
    495495                 * We must close Runtime UI: */
    496496                uisession()->closeRuntimeUI();
     497                return;
    497498            }
    498499            break;
     
    13241325    bool fDialogAccepted = pDlg->exec() == QDialog::Accepted;
    13251326
    1326     /* Is the dialog still valid? */
    1327     if (pDlg)
    1328     {
    1329         /* Acquire variables: */
    1330         QString strSnapshotName = pDlg->mLeName->text().trimmed();
    1331         QString strSnapshotDescription = pDlg->mTeDescription->toPlainText();
    1332 
    1333         /* Destroy dialog early: */
    1334         delete pDlg;
    1335 
    1336         /* Was the dialog accepted? */
    1337         if (fDialogAccepted)
     1327    /* Make sure dialog still valid: */
     1328    if (!pDlg)
     1329        return;
     1330
     1331    /* Acquire variables: */
     1332    QString strSnapshotName = pDlg->mLeName->text().trimmed();
     1333    QString strSnapshotDescription = pDlg->mTeDescription->toPlainText();
     1334
     1335    /* Destroy dialog early: */
     1336    delete pDlg;
     1337
     1338    /* Was the dialog accepted? */
     1339    if (fDialogAccepted)
     1340    {
     1341        /* Prepare the take-snapshot progress: */
     1342        CConsole console = session().GetConsole();
     1343        CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription);
     1344        if (console.isOk())
    13381345        {
    1339             /* Prepare the take-snapshot progress: */
    1340             CConsole console = session().GetConsole();
    1341             CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription);
    1342             if (console.isOk())
    1343             {
    1344                 /* Show the take-snapshot progress: */
    1345                 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_snapshot_create_90px.png");
    1346                 if (!progress.isOk() || progress.GetResultCode() != 0)
    1347                     msgCenter().cannotTakeSnapshot(progress, machine.GetName());
    1348             }
    1349             else
    1350                 msgCenter().cannotTakeSnapshot(console, machine.GetName());
     1346            /* Show the take-snapshot progress: */
     1347            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_snapshot_create_90px.png");
     1348            if (!progress.isOk() || progress.GetResultCode() != 0)
     1349                msgCenter().cannotTakeSnapshot(progress, machine.GetName());
    13511350        }
     1351        else
     1352            msgCenter().cannotTakeSnapshot(console, machine.GetName());
    13521353    }
    13531354
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette