VirtualBox

Ignore:
Timestamp:
Feb 2, 2010 7:59:09 PM (15 years ago)
Author:
vboxsync
Message:

Main: get rid of isModified() loops in Machine and subclasses; instead, on every change in machine settings, set dirty bits in Machine

File:
1 edited

Legend:

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

    r26156 r26167  
    205205        mData.backup();
    206206        mData->mEnabled = aEnabled;
     207
     208        alock.release();
     209        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     210        mParent->setModified(Machine::IsModified_AudioAdapter);
    207211    }
    208212
     
    279283                mData.backup();
    280284                mData->mAudioDriver = aAudioDriver;
     285
     286                alock.release();
     287                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     288                mParent->setModified(Machine::IsModified_AudioAdapter);
    281289                break;
    282290            }
     
    330338            case AudioControllerType_AC97:
    331339            case AudioControllerType_SB16:
     340            {
    332341                mData.backup();
    333342                mData->mAudioController = aAudioController;
     343
     344                alock.release();
     345                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     346                mParent->setModified(Machine::IsModified_AudioAdapter);
    334347                break;
     348            }
    335349
    336350            default:
    337             {
    338351                AssertMsgFailed (("Wrong audio controller type %d\n",
    339352                                  aAudioController));
    340353                rc = E_FAIL;
    341             }
    342354        }
    343355    }
     
    414426}
    415427
    416 bool AudioAdapter::isModified()
    417 {
    418     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    419     return mData.isBackedUp();
    420 }
    421 
    422428/**
    423429 *  @note Locks this object for writing.
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