VirtualBox

Changeset 24727 in vbox for trunk


Ignore:
Timestamp:
Nov 17, 2009 4:02:49 PM (15 years ago)
Author:
vboxsync
Message:

Main/MachineImpl: in DetachDrive don't forget to remove the backrefs for floppy/dvd images.

File:
1 edited

Legend:

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

    r24704 r24727  
    27262726                        aDevice, aControllerPort, aControllerName);
    27272727
     2728    ComObjPtr<Medium> oldmedium = pAttach->medium();
     2729    DeviceType_T mediumType = pAttach->type();
    27282730
    27292731    if (pAttach->isImplicit())
     
    27442746        alock.leave();
    27452747
    2746         ComObjPtr<Medium> hd = pAttach->medium();
    2747         rc = hd->deleteStorageAndWait();
     2748        rc = oldmedium->deleteStorageAndWait();
    27482749
    27492750        alock.enter();
     
    27602761     * still refers to the original and is not valid for the copy */
    27612762    mMediaData->mAttachments.remove(pAttach);
     2763
     2764    /* For non-hard disk media, detach straight away. */
     2765    if (mediumType != DeviceType_HardDisk && !oldmedium.isNull())
     2766        oldmedium->detachFrom(mData->mUuid);
    27622767
    27632768    return S_OK;
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