VirtualBox

Changeset 90698 in vbox


Ignore:
Timestamp:
Aug 16, 2021 2:15:08 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161: VirtualBox Manager: Stop all cloud related updates before detaching COM stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r88681 r90698  
    721721void UIChooserAbstractModel::sltHandleCloudProviderUninstall(const QUuid &uProviderId)
    722722{
    723     /* We should stop cloud entity updates currently being performed: */
    724     foreach (const UICloudEntityKey &key, m_cloudEntityKeysBeingUpdated)
    725     {
    726         /* For profiles: */
    727         if (key.m_uMachineId.isNull())
    728         {
    729             /* Search task child by key: */
    730             UIProgressTaskReadCloudMachineList *pTask = findChild<UIProgressTaskReadCloudMachineList*>(key.toString());
    731             AssertPtrReturnVoid(pTask);
    732 
    733             /* Wait for cloud profile refresh task to complete,
    734              * then delete the task itself manually: */
    735             pTask->cancel();
    736             delete pTask;
    737         }
    738         /* For machines: */
    739         else
    740         {
    741             /* Search machine node: */
    742             UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId);
    743             AssertPtrReturnVoid(pNode);
    744             /* Acquire cloud machine item: */
    745             UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud();
    746             AssertPtrReturnVoid(pCloudMachineItem);
    747 
    748             /* Wait for cloud machine refresh task to complete,
    749              * task itself will be deleted with the machine-node: */
    750             pCloudMachineItem->waitForAsyncInfoUpdateFinished();
    751         }
    752     }
    753 
    754     /* We haven't let tasks to unregister themselves
    755      * so we have to cleanup task set ourselves: */
    756     m_cloudEntityKeysBeingUpdated.clear();
     723    /* First of all, stop all cloud updates: */
     724    stopCloudUpdates();
    757725
    758726    /* Search and delete corresponding cloud provider node if present: */
     
    781749    delete m_pInvisibleRootNode;
    782750    m_pInvisibleRootNode = 0;
     751
     752    /* Finally, stop all cloud updates: */
     753    stopCloudUpdates();
    783754}
    784755
     
    18571828}
    18581829
     1830void UIChooserAbstractModel::stopCloudUpdates()
     1831{
     1832    /* Stop all cloud entity updates currently being performed: */
     1833    foreach (const UICloudEntityKey &key, m_cloudEntityKeysBeingUpdated)
     1834    {
     1835        /* For profiles: */
     1836        if (key.m_uMachineId.isNull())
     1837        {
     1838            /* Search task child by key: */
     1839            UIProgressTaskReadCloudMachineList *pTask = findChild<UIProgressTaskReadCloudMachineList*>(key.toString());
     1840            AssertPtrReturnVoid(pTask);
     1841
     1842            /* Wait for cloud profile refresh task to complete,
     1843             * then delete the task itself manually: */
     1844            pTask->cancel();
     1845            delete pTask;
     1846        }
     1847        /* For machines: */
     1848        else
     1849        {
     1850            /* Search machine node: */
     1851            UIChooserNode *pNode = searchMachineNode(key.m_strProviderShortName, key.m_strProfileName, key.m_uMachineId);
     1852            AssertPtrReturnVoid(pNode);
     1853            /* Acquire cloud machine item: */
     1854            UIVirtualMachineItemCloud *pCloudMachineItem = pNode->toMachineNode()->cache()->toCloud();
     1855            AssertPtrReturnVoid(pCloudMachineItem);
     1856
     1857            /* Wait for cloud machine refresh task to complete,
     1858             * task itself will be deleted with the machine-node: */
     1859            pCloudMachineItem->waitForAsyncInfoUpdateFinished();
     1860        }
     1861    }
     1862
     1863    /* We haven't let tasks to unregister themselves
     1864     * so we have to cleanup task set ourselves: */
     1865    m_cloudEntityKeysBeingUpdated.clear();
     1866}
     1867
    18591868
    18601869#include "UIChooserAbstractModel.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r88681 r90698  
    353353    /** @} */
    354354
     355    /** @name Cloud update stuff.
     356      * @{ */
     357        /** Stops all cloud updates. */
     358        void stopCloudUpdates();
     359    /** @} */
     360
    355361    /** @name General stuff.
    356362      * @{ */
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