VirtualBox

Changeset 5235 in vbox for trunk


Ignore:
Timestamp:
Oct 11, 2007 12:23:04 PM (17 years ago)
Author:
vboxsync
Message:

Main: Fixed another r24978 regression: Don't de-associate hard disks in outdated attachments of a snapshot machine object being normally uninitialized when discarding a snapshot.

File:
1 edited

Legend:

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

    r5218 r5235  
    36513651     * instance is uninitialized; SessionMachine instances refer to real
    36523652     * Machine hard disks). This is necessary for a clean re-initialization of
    3653      * the VM after successfully re-checking the accessibility state. */
     3653     * the VM after successfully re-checking the accessibility state. Note
     3654     * that in case of normal Machine or SnapshotMachine uninitialization (as
     3655     * a result of unregistering or discarding the snapshot), outdated hard
     3656     * disk attachments will already be uninitialized and deleted, so this
     3657     * code will not affect them. */
    36543658    if (mType == IsMachine || mType == IsSnapshotMachine)
    36553659    {
     
    99729976            LogFlowThisFunc (("Discarding the snapshot (reparenting children)...\n"));
    99739977
     9978            /* It is important to uninitialize and delete all snapshot's hard
     9979             * disk attachments as they are no longer valid -- otherwise the
     9980             * code in Machine::uninitDataAndChildObjects() will mistakenly
     9981             * perform hard disk deassociation. */
     9982            for (HDData::HDAttachmentList::iterator it = sm->mHDData->mHDAttachments.begin();
     9983                 it != sm->mHDData->mHDAttachments.end();)
     9984            {
     9985                (*it)->uninit();
     9986                it = sm->mHDData->mHDAttachments.erase (it);
     9987            }
     9988
    99749989            ComObjPtr <Snapshot> parentSnapshot = aTask.snapshot->parent();
    99759990
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