VirtualBox

Changeset 77039 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 30, 2019 11:18:06 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128482
Message:

Main/Machine: fix CPUID override removal, it ran into iterator/collection mismatch due to the weird semantics of Backupable<T>::backup(), never coming to an end

File:
1 edited

Legend:

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

    r76818 r77039  
    22452245     * Do the removal.
    22462246     */
    2247     bool fModified = false;
     2247    bool fModified = mHWData.isBackedUp();
    22482248    for (settings::CpuIdLeafsList::iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); )
    22492249    {
     
    22582258                i_setModified(IsModified_MachineData);
    22592259                mHWData.backup();
     2260                // Start from the beginning, since mHWData.backup() creates
     2261                // a new list, causing iterator mixup. This makes sure that
     2262                // the settings are not unnecessarily marked as modified,
     2263                // at the price of extra list walking.
     2264                it = mHWData->mCpuIdLeafList.begin();
    22602265            }
    2261             it = mHWData->mCpuIdLeafList.erase(it);
     2266            else
     2267                it = mHWData->mCpuIdLeafList.erase(it);
    22622268        }
    22632269        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