VirtualBox

Ignore:
Timestamp:
Apr 11, 2016 5:37:05 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​bugref:8312: VBoxGlobal: Small cleanup for global UI prepare/cleanup procedures, mostly comments but also some code order, s.a. r106421.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r60362 r60436  
    43524352    mValid = true;
    43534353
     4354    /* Prepare converter: */
    43544355    UIConverter::prepare();
    43554356
    4356     /* Create medium enumerator but don't do any immediate caching. */
     4357    /* Create medium-enumerator but don't do any immediate caching: */
    43574358    m_pMediumEnumerator = new UIMediumEnumerator;
    43584359    {
     
    43894390void VBoxGlobal::cleanup()
    43904391{
    4391     /* Preventing some unwanted stuff
    4392      * which could de called from the other threads: */
     4392    // TODO: Shouldn't that be protected with a mutex or something?
     4393    /* Remember that the cleanup is in progress preventing any unwanted
     4394     * stuff which could be called from the other threads: */
    43934395    m_sfCleanupInProgress = true;
    43944396
     
    44064408#ifdef VBOX_GUI_WITH_PIDFILE
    44074409    deletePidfile();
    4408 #endif
    4409 
    4410     /* Destroy the GUI root windows _BEFORE_ the media-mess, because there is
    4411        code in the GUI that's using the media code an will be racing us! */
     4410#endif /* VBOX_GUI_WITH_PIDFILE */
     4411
     4412    /* Destroy the GUI root windows _BEFORE_
     4413     * the media related code which could race us: */
    44124414    if (gpSelectorWindow)
    44134415        UISelectorWindow::destroy();
    44144416    if (gpMachine)
    44154417        UIMachine::destroy();
    4416     /* As part of recent change UIVirtualBoxEventHandler also used in runtimeUI.
    4417      * This needs to be destroyed before COM cleanup. As this is supposed to be only part of selectorUI,
    4418      * and needs to be reworked later doing this here for now: */
    4419     if (gpMachine)
    4420         UIVirtualBoxEventHandler::destroy();
    4421 
    4422     /* Cleanup medium-enumerator: */
     4418
     4419    /* Starting medium-enumerator cleanup: */
    44234420    m_mediumEnumeratorDtorRwLock.lockForWrite();
    4424     delete m_pMediumEnumerator;
    4425     m_pMediumEnumerator = 0;
     4421    {
     4422        /* Destroy medium-enumerator: */
     4423        delete m_pMediumEnumerator;
     4424        m_pMediumEnumerator = 0;
     4425    }
     4426    /* Finishing medium-enumerator cleanup: */
    44264427    m_mediumEnumeratorDtorRwLock.unlock();
    44274428
    4428     /* Destroy extra-data manager: */
     4429    /* Destroy the global (VirtualBox) Main event handler
     4430     * which is used in both Selector and Runtime UI. */
     4431    UIVirtualBoxEventHandler::destroy();
     4432
     4433    /* Destroy the extra-data manager finally after everything
     4434     * above which could use it already destroyed: */
    44294435    UIExtraDataManager::destroy();
    44304436
    4431     /* Destroy whatever this converter stuff is: */
     4437    /* Cleanup converter: */
    44324438    UIConverter::cleanup();
    44334439
     
    44394445    m_pIconPool = 0;
    44404446
    4441     /* ensure CGuestOSType objects are no longer used */
     4447    /* Ensure CGuestOSType objects are no longer used: */
    44424448    m_guestOSFamilyIDs.clear();
    44434449    m_guestOSTypes.clear();
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