Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 52992)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 52993)
@@ -495,4 +495,5 @@
                  * We must close Runtime UI: */
                 uisession()->closeRuntimeUI();
+                return;
             }
             break;
@@ -1324,30 +1325,30 @@
     bool fDialogAccepted = pDlg->exec() == QDialog::Accepted;
 
-    /* Is the dialog still valid? */
-    if (pDlg)
-    {
-        /* Acquire variables: */
-        QString strSnapshotName = pDlg->mLeName->text().trimmed();
-        QString strSnapshotDescription = pDlg->mTeDescription->toPlainText();
-
-        /* Destroy dialog early: */
-        delete pDlg;
-
-        /* Was the dialog accepted? */
-        if (fDialogAccepted)
+    /* Make sure dialog still valid: */
+    if (!pDlg)
+        return;
+
+    /* Acquire variables: */
+    QString strSnapshotName = pDlg->mLeName->text().trimmed();
+    QString strSnapshotDescription = pDlg->mTeDescription->toPlainText();
+
+    /* Destroy dialog early: */
+    delete pDlg;
+
+    /* Was the dialog accepted? */
+    if (fDialogAccepted)
+    {
+        /* Prepare the take-snapshot progress: */
+        CConsole console = session().GetConsole();
+        CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription);
+        if (console.isOk())
         {
-            /* Prepare the take-snapshot progress: */
-            CConsole console = session().GetConsole();
-            CProgress progress = console.TakeSnapshot(strSnapshotName, strSnapshotDescription);
-            if (console.isOk())
-            {
-                /* Show the take-snapshot progress: */
-                msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_snapshot_create_90px.png");
-                if (!progress.isOk() || progress.GetResultCode() != 0)
-                    msgCenter().cannotTakeSnapshot(progress, machine.GetName());
-            }
-            else
-                msgCenter().cannotTakeSnapshot(console, machine.GetName());
+            /* Show the take-snapshot progress: */
+            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_snapshot_create_90px.png");
+            if (!progress.isOk() || progress.GetResultCode() != 0)
+                msgCenter().cannotTakeSnapshot(progress, machine.GetName());
         }
+        else
+            msgCenter().cannotTakeSnapshot(console, machine.GetName());
     }
 
