VirtualBox

Changeset 31344 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 3, 2010 3:58:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64383
Message:

Main: Machine::Delete(): move saveSettings() to worker thread

File:
1 edited

Legend:

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

    r31343 r31344  
    40904090    std::list<Utf8Str>          llFilesToDelete;
    40914091    ComObjPtr<Progress>         pProgress;
     4092    bool                        fNeedsGlobalSaveSettings;
    40924093};
    40934094
     
    41004101
    41014102    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    4102 
    4103     bool fNeedsGlobalSaveSettings = false;
    41044103
    41054104    HRESULT rc = checkStateDependency(MutableStateDep);
     
    41164115    // collect files to delete
    41174116    pTask->llFilesToDelete = mData->llFilesToDelete;            // saved states pushed here by Unregister()
     4117
     4118    pTask->fNeedsGlobalSaveSettings = false;
    41184119    for (size_t i = 0; i < sfaMedia.size(); ++i)
    41194120    {
     
    41264127        // close the medium now; if that succeeds, then that means the medium is no longer
    41274128        // in use and we can add it to the list of files to delete
    4128         rc = pMedium->close(&fNeedsGlobalSaveSettings, mediumAutoCaller);
     4129        rc = pMedium->close(&pTask->fNeedsGlobalSaveSettings,
     4130                            mediumAutoCaller);
    41294131        if (SUCCEEDED(rc))
    41304132            pTask->llFilesToDelete.push_back(bstrLocation);
     
    41504152
    41514153    pTask->pProgress.queryInterfaceTo(aProgress);
    4152 
    4153     alock.release();
    4154 
    4155     if (fNeedsGlobalSaveSettings)
    4156     {
    4157         AutoWriteLock vboxlock(mParent COMMA_LOCKVAL_SRC_POS);
    4158         mParent->saveSettings();
    4159     }
    41604154
    41614155    if (RT_FAILURE(vrc))
     
    42964290                RTDirRemove(settingsDir.c_str());
    42974291        }
     4292    }
     4293
     4294    alock.release();
     4295
     4296    if (task.fNeedsGlobalSaveSettings)
     4297    {
     4298        AutoWriteLock vboxlock(mParent COMMA_LOCKVAL_SRC_POS);
     4299        mParent->saveSettings();
    42984300    }
    42994301
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette