Index: /trunk/src/VBox/Main/src-server/HostImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/HostImpl.cpp	(revision 37094)
+++ /trunk/src/VBox/Main/src-server/HostImpl.cpp	(revision 37095)
@@ -1659,7 +1659,6 @@
 
             // remove drives from the cached list which are no longer present
-            for (MediaList::iterator itCached = pllCached->begin();
-                 itCached != pllCached->end();
-                 ++itCached)
+            MediaList::iterator itCached = pllCached->begin();
+            while (itCached != pllCached->end())
             {
                 Medium *pCached = *itCached;
@@ -1680,4 +1679,6 @@
                 if (!fFound)
                     itCached = pllCached->erase(itCached);
+                else
+                    ++itCached;
             }
 
