Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 52986)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 52987)
@@ -213,4 +213,5 @@
     machineLogic()->initializePostPowerUp();
 
+    /* True by default: */
     return true;
 }
@@ -242,9 +243,7 @@
 QWidget* UIMachine::activeWindow() const
 {
-    /* Null if machine-logic not yet created: */
-    if (!machineLogic())
-        return 0;
-    /* Active machine-window otherwise: */
-    return machineLogic()->activeMachineWindow();
+    if (machineLogic() &&  machineLogic()->activeMachineWindow())
+        return machineLogic()->activeMachineWindow();
+    return 0;
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 52986)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h	(revision 52987)
@@ -35,4 +35,6 @@
 class UIMachineLogic;
 
+/** Singleton QObject extension
+  * used as virtual machine (VM) singleton instance. */
 class UIMachine : public QObject
 {
@@ -53,8 +55,9 @@
     UIMachine();
     /** Destructor. */
-    virtual ~UIMachine();
+    ~UIMachine();
 
-    /* Public getters: */
+    /** Returns active machine-window reference (if possible). */
     QWidget* activeWindow() const;
+    /** Returns UI session instance. */
     UISession *uisession() const { return m_pSession; }
 
@@ -67,21 +70,22 @@
 private slots:
 
-    /* Visual state-change handler: */
+    /** Visual state-change handler. */
     void sltChangeVisualState(UIVisualStateType visualStateType);
 
 private:
 
+    /** Prepare routine. */
     bool prepare();
 
-    /* Move VM to default (normal) state: */
+    /** Moves VM to default (normal) state. */
     void enterInitialVisualState();
 
-    /* Private getters: */
+    /** Returns machine-logic reference (if possible). */
     UIMachineLogic* machineLogic() const;
 
-    /* Prepare helpers: */
+    /** Prepare routine: Loading stuff. */
     void loadMachineSettings();
 
-    /* Cleanup helpers: */
+    /** Prepare routine: Saving stuff. */
     void saveMachineSettings();
 
@@ -98,3 +102,2 @@
 
 #endif /* !___UIMachine_h___ */
-
