Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 30054)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 30055)
@@ -9754,6 +9754,11 @@
     mData.free();
 
+#if 1 /** @todo Please review this change! (bird) */
+    /* drop the exclusive lock before setting the below two to NULL */
+    multilock.release();
+#else
     /* leave the exclusive lock before setting the below two to NULL */
     multilock.leave();
+#endif
 
     unconst(mParent) = NULL;
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 30054)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 30055)
@@ -691,5 +691,13 @@
 
     LogFlowThisFunc(("Uninitializing machines (%d)...\n", m->ollMachines.size()));
-    m->ollMachines.uninitAll();
+    if (m->pHost)
+    {
+        /* It is necessary to hold the VirtualBox and Host locks here because
+           we may have to uninitialize SessionMachines. */
+        AutoMultiWriteLock2 multilock(this, m->pHost COMMA_LOCKVAL_SRC_POS);
+        m->ollMachines.uninitAll();
+    }
+    else
+        m->ollMachines.uninitAll();
     m->ollFloppyImages.uninitAll();
     m->ollDVDImages.uninitAll();
Index: /trunk/src/VBox/Main/glue/ErrorInfo.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/ErrorInfo.cpp	(revision 30054)
+++ /trunk/src/VBox/Main/glue/ErrorInfo.cpp	(revision 30055)
@@ -135,4 +135,7 @@
         }
     }
+    /* Ignore failure when called after nsComponentManagerImpl::Shutdown(). */
+    else if (rc == NS_ERROR_UNEXPECTED)
+        rc = NS_OK;
 
     AssertComRC (rc);
