Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 42823)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 42824)
@@ -177,10 +177,10 @@
     /** Constructs a regular enum event */
     VBoxMediaEnumEvent (const UIMedium &aMedium,
-                        VBoxMediaList::iterator &aIterator)
+                        const VBoxMediaList::iterator &aIterator)
         : QEvent ((QEvent::Type) MediaEnumEventType)
         , mMedium (aMedium), mIterator (aIterator), mLast (false)
         {}
     /** Constructs the last enum event */
-    VBoxMediaEnumEvent (VBoxMediaList::iterator &aIterator)
+    VBoxMediaEnumEvent (const VBoxMediaList::iterator &aIterator)
         : QEvent ((QEvent::Type) MediaEnumEventType)
         , mIterator (aIterator), mLast (true)
@@ -189,7 +189,6 @@
     /** Last enumerated medium (not valid when #last is true) */
     const UIMedium mMedium;
-    /** Opaque iterator provided by the event sender (guaranteed to be
-     *  the same variable for all media in the single enumeration procedure) */
-    VBoxMediaList::iterator &mIterator;
+    /* Iterator which points to the corresponding item in the GUI thread: */
+    const VBoxMediaList::iterator mIterator;
     /** Whether this is the last event for the given enumeration or not */
     const bool mLast;
@@ -2013,4 +2012,5 @@
                     postEvent (self,
                                new VBoxMediaEnumEvent (mVector [i], mSavedIt));
+                ++mSavedIt;
             }
 
@@ -4024,5 +4024,4 @@
                 *(ev->mIterator) = ev->mMedium;
                 emit mediumEnumerated (*ev->mIterator);
-                ++ ev->mIterator;
             }
             else
