VirtualBox

Changeset 42824 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 15, 2012 1:30:18 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Medium-enumeration race fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r42748 r42824  
    177177    /** Constructs a regular enum event */
    178178    VBoxMediaEnumEvent (const UIMedium &aMedium,
    179                         VBoxMediaList::iterator &aIterator)
     179                        const VBoxMediaList::iterator &aIterator)
    180180        : QEvent ((QEvent::Type) MediaEnumEventType)
    181181        , mMedium (aMedium), mIterator (aIterator), mLast (false)
    182182        {}
    183183    /** Constructs the last enum event */
    184     VBoxMediaEnumEvent (VBoxMediaList::iterator &aIterator)
     184    VBoxMediaEnumEvent (const VBoxMediaList::iterator &aIterator)
    185185        : QEvent ((QEvent::Type) MediaEnumEventType)
    186186        , mIterator (aIterator), mLast (true)
     
    189189    /** Last enumerated medium (not valid when #last is true) */
    190190    const UIMedium mMedium;
    191     /** Opaque iterator provided by the event sender (guaranteed to be
    192      *  the same variable for all media in the single enumeration procedure) */
    193     VBoxMediaList::iterator &mIterator;
     191    /* Iterator which points to the corresponding item in the GUI thread: */
     192    const VBoxMediaList::iterator mIterator;
    194193    /** Whether this is the last event for the given enumeration or not */
    195194    const bool mLast;
     
    20132012                    postEvent (self,
    20142013                               new VBoxMediaEnumEvent (mVector [i], mSavedIt));
     2014                ++mSavedIt;
    20152015            }
    20162016
     
    40244024                *(ev->mIterator) = ev->mMedium;
    40254025                emit mediumEnumerated (*ev->mIterator);
    4026                 ++ ev->mIterator;
    40274026            }
    40284027            else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette