VirtualBox

Changeset 29149 in vbox


Ignore:
Timestamp:
May 6, 2010 12:55:49 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61220
Message:

Main/Medium: add forgotten medium registry save when deleting the storage representation of a medium.

File:
1 edited

Legend:

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

    r29028 r29149  
    39083908
    39093909        /* try to remove from the list of known hard disks before performing
    3910          * actual deletion (we favor the consistency of the media registry in
    3911          * the first place which would have been broken if
    3912          * unregisterWithVirtualBox() failed after we successfully deleted the
    3913          * storage) */
    3914         rc = unregisterWithVirtualBox(pfNeedsSaveSettings);
     3910         * actual deletion (we favor the consistency of the media registry
     3911         * which would have been broken if unregisterWithVirtualBox() failed
     3912         * after we successfully deleted the storage) */
     3913        bool fNeedsSaveSettings = false;
     3914        rc = unregisterWithVirtualBox(&fNeedsSaveSettings);
    39153915        if (FAILED(rc))
    39163916            throw rc;
     3917        // no longer need lock, and below we might need the VirtualBox lock.
     3918        multilock.release();
     3919        if (fNeedsSaveSettings)
     3920        {
     3921            AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS);
     3922            m->pVirtualBox->saveSettings();
     3923        }
     3924        // always set it to false because the medium registry is up to date
     3925        if (pfNeedsSaveSettings)
     3926            *pfNeedsSaveSettings = false;
    39173927
    39183928        if (aProgress != NULL)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette