VirtualBox

Changeset 42788 in vbox for trunk


Ignore:
Timestamp:
Aug 13, 2012 9:49:33 AM (12 years ago)
Author:
vboxsync
Message:

Main/Machine:

  1. function STDMETHODIMP Machine::RemoveStorageController - replaced Iterator in the cycle by simple counter for go through all meadia attachments.
  2. function STDMETHODIMP Machine::RemoveStorageController - replaced DetachDevice by detachDevice.
File:
1 edited

Legend:

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

    r42757 r42788  
    59455945    {
    59465946        /* find all attached devices to the appropriate storage controller and detach them all*/
    5947         MediaData::AttachmentList::const_iterator endList = mMediaData->mAttachments.end();
    59485947        MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
    5949         for (;it != endList; it++)
    5950         {
    5951             MediumAttachment *pAttachTemp = *it;
     5948
     5949        uint16_t howManyAttach = mMediaData->mAttachments.size();
     5950
     5951        for (uint16_t i=0;i<howManyAttach; ++i)
     5952        {
     5953            MediumAttachment *pAttachTemp = *it++;
     5954
    59525955            AutoCaller localAutoCaller(pAttachTemp);
    59535956            if (FAILED(localAutoCaller.rc())) return localAutoCaller.rc();
     
    59595962                LONG port = pAttachTemp->getPort();
    59605963                LONG device = pAttachTemp->getDevice();
    5961                 rc = DetachDevice(aName, port, device);
     5964
     5965                //rc = DetachDevice(aName, port, device);
     5966                rc = detachDevice(pAttachTemp, alock, NULL);
    59625967                if (FAILED(rc)) return rc;
    59635968            }
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