VirtualBox

Changeset 30314 in vbox for trunk/src


Ignore:
Timestamp:
Jun 18, 2010 3:33:22 PM (15 years ago)
Author:
vboxsync
Message:

Main: fixes to saveSettings and locking calls, part 2

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r30309 r30314  
    54335433    }
    54345434
     5435    // deregister the task registered in createDiffStorage()
     5436    Assert(m->numCreateDiffTasks != 0);
     5437    --m->numCreateDiffTasks;
     5438
    54355439    if (task.isAsync())
    54365440    {
     
    54465450        if (task.m_pfNeedsSaveSettings)
    54475451            *task.m_pfNeedsSaveSettings = fNeedsSaveSettings;
    5448 
    5449     /* deregister the task registered in createDiffStorage() */
    5450     Assert(m->numCreateDiffTasks != 0);
    5451     --m->numCreateDiffTasks;
    54525452
    54535453    /* Note that in sync mode, it's the caller's responsibility to
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r30207 r30314  
    34963496
    34973497/**
    3498  *  Helper function to write out the configuration tree.
     3498 *  Helper function which actually writes out VirtualBox.xml, the main configuration file.
     3499 *  Gets called from the public VirtualBox::SaveSettings() as well as from various other
     3500 *  places internally when settings need saving.
    34993501 *
    35003502 *  @note Caller must have locked the VirtualBox object for writing!
     
    35693571        settings::MediaList hardDisksTemp;
    35703572        for (MediaList::const_iterator it = m->ollHardDisks.begin();
    3571                 it != m->ollHardDisks.end();
    3572                 ++it)
     3573             it != m->ollHardDisks.end();
     3574             ++it)
    35733575        {
    35743576            settings::Medium med;
     
    35813583        settings::MediaList dvdsTemp;
    35823584        for (MediaList::const_iterator it = m->ollDVDImages.begin();
    3583                 it != m->ollDVDImages.end();
    3584                 ++it)
     3585             it != m->ollDVDImages.end();
     3586             ++it)
    35853587        {
    35863588            settings::Medium med;
     
    35933595        settings::MediaList floppiesTemp;
    35943596        for (MediaList::const_iterator it = m->ollFloppyImages.begin();
    3595                 it != m->ollFloppyImages.end();
    3596                 ++it)
     3597             it != m->ollFloppyImages.end();
     3598             ++it)
    35973599        {
    35983600            settings::Medium med;
     
    45884590        {
    45894591            listeners.Add(*pp);
    4590         }                   
    4591 #endif 
     4592        }
     4593#endif
    45924594    }
    45934595
     
    46134615
    46144616        /**
    4615          * Would be just handleCallback(cbI) in an ideal world, unfortunately our 
     4617         * Would be just handleCallback(cbI) in an ideal world, unfortunately our
    46164618         * consumers want to be invoked via IDispatch, thus going the hard way.
    46174619         */
     
    47694771    if (aSaveRegistry)
    47704772    {
     4773        AutoWriteLock vboxLock(this COMMA_LOCKVAL_SRC_POS);
    47714774        rc = saveSettings();
     4775        vboxLock.release();
     4776
    47724777        if (FAILED(rc))
    47734778            unregisterDHCPServer(aDHCPServer, false /* aSaveRegistry */);
     
    48114816    if (aSaveRegistry)
    48124817    {
     4818        AutoWriteLock vboxLock(this COMMA_LOCKVAL_SRC_POS);
    48134819        rc = saveSettings();
     4820        vboxLock.release();
     4821
    48144822        if (FAILED(rc))
    48154823            registerDHCPServer(aDHCPServer, false /* aSaveRegistry */);
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