VirtualBox

Changeset 18173 in vbox for trunk/src


Ignore:
Timestamp:
Mar 24, 2009 11:20:24 AM (16 years ago)
Author:
vboxsync
Message:

Main: Protect every use of the StorageController list and remove second unneccessary call to rollback

File:
1 edited

Legend:

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

    r18162 r18173  
    77507750    }
    77517751
    7752     if (mStorageControllers.isBackedUp())
    7753     {
    7754         /* unitialize all new devices (absent in the backed up list). */
    7755         StorageControllerList::const_iterator it = mStorageControllers->begin();
    7756         StorageControllerList *backedList = mStorageControllers.backedUpData();
    7757         while (it != mStorageControllers->end())
    7758         {
    7759             if (std::find (backedList->begin(), backedList->end(), *it ) ==
    7760                 backedList->end())
     7752    if (!mStorageControllers.isNull())
     7753    {
     7754        if (mStorageControllers.isBackedUp())
     7755        {
     7756            /* unitialize all new devices (absent in the backed up list). */
     7757            StorageControllerList::const_iterator it = mStorageControllers->begin();
     7758            StorageControllerList *backedList = mStorageControllers.backedUpData();
     7759            while (it != mStorageControllers->end())
    77617760            {
    7762                 (*it)->uninit();
     7761                if (std::find (backedList->begin(), backedList->end(), *it ) ==
     7762                    backedList->end())
     7763                {
     7764                    (*it)->uninit();
     7765                }
     7766                ++ it;
    77637767            }
    7764             ++ it;
    7765         }
    7766 
    7767         /* restore the list */
    7768         mStorageControllers.rollback();
    7769     }
    7770 
    7771     if (!mStorageControllers.isNull())
    7772     {
     7768
     7769            /* restore the list */
     7770            mStorageControllers.rollback();
     7771        }
     7772
    77737773        /* rollback any changes to devices after restoring the list */
    77747774        StorageControllerList::const_iterator it = mStorageControllers->begin();
     
    77857785
    77867786    mHWData.rollback();
    7787 
    7788     mStorageControllers.rollback();
    77897787
    77907788    if (mHDData.isBackedUp())
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