VirtualBox

Changeset 37096 in vbox


Ignore:
Timestamp:
May 16, 2011 9:28:34 AM (14 years ago)
Author:
vboxsync
Message:

Main: fix iterator erase mess

File:
1 edited

Legend:

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

    r36575 r37096  
    25832583    {
    25842584        settings::AttachedDevicesList &llAttachments = it3->llAttachedDevices;
    2585         settings::AttachedDevicesList::iterator it4;
    2586         for (it4 = llAttachments.begin();
    2587              it4 != llAttachments.end();
    2588              ++it4)
     2585        settings::AttachedDevicesList::iterator it4 = llAttachments.begin();
     2586        while (it4 != llAttachments.end())
    25892587        {
    25902588            if (  (   !fDVD
     
    25932591                  (   !fFloppy
    25942592                   && it4->deviceType == DeviceType_Floppy))
    2595                 llAttachments.erase(it4++);
     2593            {
     2594                it4 = llAttachments.erase(it4);
     2595                continue;
     2596            }
    25962597            else if (it4->deviceType == DeviceType_HardDisk)
    25972598            {
     
    26132614                }
    26142615            }
     2616            ++it4;
    26152617        }
    26162618    }
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