Changeset 31223 in vbox
- Timestamp:
- Jul 29, 2010 4:15:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r31218 r31223 4126 4126 llMedia.push_back(pMedium); 4127 4127 4128 detachDevice(pAttach, 4129 alock, 4130 NULL /* pfNeedsSaveSettings */); 4128 HRESULT rc = detachDevice(pAttach, 4129 alock, 4130 NULL /* pfNeedsSaveSettings */); 4131 if (FAILED(rc)) 4132 break; 4131 4133 }; 4132 4134 } … … 4137 4139 } 4138 4140 4141 if (FAILED(rc)) 4142 { 4143 rollbackMedia(); 4144 return rc; 4145 } 4146 4139 4147 // commit all the media changes made above 4140 4148 commitMedia(); … … 4148 4156 { 4149 4157 // now go thru the list of attached media reported by prepareUnregister() and close them all 4150 size_t u = 0;4151 4158 for (MediaList::const_iterator it = llMedia.begin(); 4152 4159 it != llMedia.end(); … … 4159 4166 if (FAILED(autoCaller2.rc())) return autoCaller2.rc(); 4160 4167 4161 pMedium->close(NULL /*fNeedsSaveSettings*/, // we'll call saveSettings() in any case below 4162 autoCaller2); 4168 ErrorInfoKeeper eik; 4169 HRESULT rc = pMedium->close(NULL /*fNeedsSaveSettings*/, // we'll call saveSettings() in any case below 4170 autoCaller2); 4163 4171 // this uninitializes the medium 4164 4172 4165 // report the path to the caller 4166 llFilesForCaller.push_back(bstrFile); 4167 ++u; 4173 if (rc == VBOX_E_OBJECT_IN_USE) 4174 // can happen if the medium was still attached to another machine; 4175 // do not report the file to the caller then, but don't report 4176 // an error either 4177 eik.setNull(); 4178 else if (SUCCEEDED(rc)) 4179 // report the path to the caller 4180 llFilesForCaller.push_back(bstrFile); 4168 4181 } 4169 4182 }
Note:
See TracChangeset
for help on using the changeset viewer.