VirtualBox

Changeset 29192 in vbox for trunk/src


Ignore:
Timestamp:
May 7, 2010 9:54:07 AM (15 years ago)
Author:
vboxsync
Message:

Main/Machine: actually fulfill the locking requirements of the internal method used by getMediumAttachmentsOfController()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r28949 r29192  
    73327332         ++it)
    73337333    {
    7334         if ((*it)->getControllerName() == aName)
    7335             atts.push_back(*it);
     7334        const ComObjPtr<MediumAttachment> &pAtt = *it;
     7335
     7336        // should never happen, but deal with NULL pointers in the list.
     7337        AssertStmt(!pAtt.isNull(), continue);
     7338
     7339        // getControllerName() needs caller+read lock
     7340        AutoCaller autoAttCaller(pAtt);
     7341        if (FAILED(autoAttCaller.rc()))
     7342        {
     7343            atts.clear();
     7344            return autoAttCaller.rc();
     7345        }
     7346        AutoReadLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);
     7347
     7348        if (pAtt->getControllerName() == aName)
     7349            atts.push_back(pAtt);
    73367350    }
    73377351
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