Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 37930)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 37931)
@@ -794,4 +794,9 @@
     // uninit media from this machine's media registry, if they're still there
     Guid uuidMachine(getId());
+
+    /* XXX This will fail with
+     *   "cannot be closed because it is still attached to 1 virtual machines"
+     * because at this point we did not call uninitDataAndChildObjects() yet
+     * and therefore also removeBackReference() for all these mediums was not called! */
     if (!uuidMachine.isEmpty())     // can be empty if we're called from a failure of Machine::init
         mParent->unregisterMachineMedia(uuidMachine);
