Changeset 29204 in vbox
- Timestamp:
- May 7, 2010 12:44:33 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r29149 r29204 2162 2162 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2163 2163 2164 bool fNeedsSaveSettings = false; 2164 2165 ComObjPtr <Progress> pProgress; 2165 2166 2166 HRESULT rc = deleteStorage(&pProgress, false /* aWait */, 2167 NULL /* pfNeedsSaveSettings */); 2167 HRESULT rc = deleteStorage(&pProgress, 2168 false /* aWait */, 2169 &fNeedsSaveSettings); 2170 if (fNeedsSaveSettings) 2171 { 2172 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2173 m->pVirtualBox->saveSettings(); 2174 } 2175 2168 2176 if (SUCCEEDED(rc)) 2169 2177 pProgress.queryInterfaceTo(aProgress); … … 3911 3919 * which would have been broken if unregisterWithVirtualBox() failed 3912 3920 * after we successfully deleted the storage) */ 3913 bool fNeedsSaveSettings = false; 3914 rc = unregisterWithVirtualBox(&fNeedsSaveSettings); 3921 rc = unregisterWithVirtualBox(pfNeedsSaveSettings); 3915 3922 if (FAILED(rc)) 3916 3923 throw rc; 3917 // no longer need lock , and below we might need the VirtualBox lock.3924 // no longer need lock 3918 3925 multilock.release(); 3919 if (fNeedsSaveSettings) 3920 { 3921 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 3922 m->pVirtualBox->saveSettings(); 3923 } 3926 3924 3927 // always set it to false because the medium registry is up to date 3925 3928 if (pfNeedsSaveSettings) -
trunk/src/VBox/Main/SnapshotImpl.cpp
r29036 r29204 1714 1714 1715 1715 bool stateRestored = false; 1716 bool fNeeds SaveSettings = false;1716 bool fNeedsGlobalSaveSettings = false; 1717 1717 1718 1718 try … … 1760 1760 1, 1761 1761 false /* aOnline */, 1762 &fNeeds SaveSettings);1762 &fNeedsGlobalSaveSettings); 1763 1763 if (FAILED(rc)) 1764 1764 throw rc; … … 1893 1893 1894 1894 // save machine settings, reset the modified flag and commit; 1895 rc = saveSettings(&fNeedsSaveSettings, SaveS_ResetCurStateModified | saveFlags); 1895 rc = saveSettings(&fNeedsGlobalSaveSettings, 1896 SaveS_ResetCurStateModified | saveFlags); 1896 1897 if (FAILED(rc)) 1897 1898 throw rc; … … 1910 1911 HRESULT rc2 = pMedium->deleteStorage(NULL /* aProgress */, 1911 1912 true /* aWait */, 1912 &fNeeds SaveSettings);1913 &fNeedsGlobalSaveSettings); 1913 1914 // ignore errors here because we cannot roll back after saveSettings() above 1914 1915 if (SUCCEEDED(rc2)) 1915 1916 pMedium->uninit(); 1916 1917 } 1917 1918 if (fNeedsSaveSettings)1919 {1920 // finally, VirtualBox.xml needs saving too1921 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);1922 mParent->saveSettings();1923 }1924 1918 } 1925 1919 catch (HRESULT aRC) … … 1942 1936 updateMachineStateOnClient(); 1943 1937 } 1938 } 1939 1940 if (fNeedsGlobalSaveSettings) 1941 { 1942 // finally, VirtualBox.xml needs saving too 1943 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1944 mParent->saveSettings(); 1944 1945 } 1945 1946
Note:
See TracChangeset
for help on using the changeset viewer.