mirror of https://github.com/BOINC/boinc.git
VBOX: Fix crash if DVD-ROM media had been ejected by some external event. Technically this shouldn't be happening, but something funky is going on with VirtualBox and we need to handle things that may cause a crash when cleaning up the VM.
This commit is contained in:
parent
f1b8c697be
commit
f2a7c28fc0
|
@ -1144,7 +1144,11 @@ int VBOX_VM::deregister_vm(bool delete_media) {
|
|||
pMediumAttachment->get_Port(&lPort);
|
||||
pMediumAttachment->get_Medium(&pMedium);
|
||||
|
||||
mediums.push_back(CComPtr<IMedium>(pMedium));
|
||||
// If the device in question is a DVD/CD-ROM drive, the medium may have been ejected.
|
||||
// If so, pMedium will be NULL.
|
||||
if (pMedium) {
|
||||
mediums.push_back(CComPtr<IMedium>(pMedium));
|
||||
}
|
||||
|
||||
rc = pMachine->DetachDevice(strController, lPort, lDevice);
|
||||
CHECK_ERROR(rc);
|
||||
|
|
Loading…
Reference in New Issue