VirtualBox

Changeset 26042 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jan 26, 2010 11:14:03 AM (15 years ago)
Author:
vboxsync
Message:

Main: fix assertion and locking order violation registering ISO/RAW images

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

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

    r25998 r26042  
    29842984    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    29852985
    2986     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     2986    // we're calling host methods for getting DVD and floppy drives so lock host first
     2987    AutoMultiWriteLock2 alock(mParent->host(), this COMMA_LOCKVAL_SRC_POS);
    29872988
    29882989    ComObjPtr<MediumAttachment> pAttach = findAttachment(mMediaData->mAttachments,
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r25903 r26042  
    14381438
    14391439/** @note Doesn't lock anything. */
    1440 STDMETHODIMP VirtualBox::OpenDVDImage (IN_BSTR aLocation, IN_BSTR aId,
    1441                                        IMedium **aDVDImage)
     1440STDMETHODIMP VirtualBox::OpenDVDImage(IN_BSTR aLocation, IN_BSTR aId,
     1441                                      IMedium **aDVDImage)
    14421442{
    14431443    CheckComArgStrNotEmptyOrNull(aLocation);
     
    14561456    ComObjPtr<Medium> image;
    14571457    image.createObject();
    1458     rc = image->init (this, aLocation, Medium::OpenReadOnly, DeviceType_DVD, true, id, false, Guid());
     1458    rc = image->init(this, aLocation, Medium::OpenReadOnly, DeviceType_DVD, true, id, false, Guid());
    14591459    if (SUCCEEDED(rc))
    14601460    {
     1461        AutoWriteLock treeLock(getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    14611462        bool fNeedsSaveSettings = false;
    14621463        rc = registerImage(image, DeviceType_DVD, &fNeedsSaveSettings);
     1464        treeLock.release();
    14631465
    14641466        if (SUCCEEDED(rc))
     
    15331535    if (SUCCEEDED(rc))
    15341536    {
     1537        AutoWriteLock treeLock(getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    15351538        bool fNeedsSaveSettings = false;
    15361539        rc = registerImage(image, DeviceType_Floppy, &fNeedsSaveSettings);
     1540        treeLock.release();
    15371541
    15381542        if (SUCCEEDED(rc))
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