- Timestamp:
- Nov 23, 2023 1:07:40 PM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r101382 r102274 216 216 , m_fWrappersValid(false) 217 217 , m_fVBoxSVCAvailable(true) 218 , m_pGuestOSTypeManager(new UIGuestOSTypeManager)219 218 , m_pThreadPool(0) 220 219 , m_pThreadPoolCloud(0) 220 , m_pGuestOSTypeManager(0) 221 221 , m_pMediumEnumerator(0) 222 222 { … … 227 227 UICommon::~UICommon() 228 228 { 229 delete m_pGuestOSTypeManager;230 229 /* Unassign instance: */ 231 230 s_pInstance = 0; … … 267 266 /* Load translation based on the current locale: */ 268 267 UITranslator::loadLanguage(); 268 269 /* Prepare guest OS type manager before COM stuff: */ 270 m_pGuestOSTypeManager = new UIGuestOSTypeManager; 269 271 270 272 HRESULT rc = COMBase::InitializeCOM(true); … … 815 817 m_pThreadPoolCloud = 0; 816 818 819 /* Cleanup guest OS type manager before COM stuff: */ 820 delete m_pGuestOSTypeManager; 821 m_pGuestOSTypeManager = 0; 822 817 823 /* Starting COM cleanup: */ 818 824 m_comCleanupProtectionToken.lockForWrite(); … … 1393 1399 { 1394 1400 emit sigCloudMachineRegistered(strProviderShortName, strProfileName, comMachine); 1401 } 1402 1403 const UIGuestOSTypeManager &UICommon::guestOSTypeManager() 1404 { 1405 /* Handle exceptional and undesired case! 1406 * This object is created and destroyed within own timeframe. 1407 * If pointer isn't yet initialized or already cleaned up, 1408 * something is definitely wrong. */ 1409 AssertPtr(m_pGuestOSTypeManager); 1410 if (!m_pGuestOSTypeManager) 1411 { 1412 m_pGuestOSTypeManager = new UIGuestOSTypeManager; 1413 m_pGuestOSTypeManager->reCacheGuestOSTypes(m_comVBox.GetGuestOSTypes()); 1414 } 1415 1416 /* Return an object instance: */ 1417 return *m_pGuestOSTypeManager; 1395 1418 } 1396 1419 … … 2509 2532 KGraphicsControllerType UICommon::getRecommendedGraphicsController(const QString &strGuestOSTypeId) const 2510 2533 { 2511 if (!m_pGuestOSTypeManager)2512 return KGraphicsControllerType_Null;2513 return m_pGuestOSTypeManager->getRecommendedGraphicsController(strGuestOSTypeId);2534 return m_pGuestOSTypeManager 2535 ? m_pGuestOSTypeManager->getRecommendedGraphicsController(strGuestOSTypeId) 2536 : KGraphicsControllerType_Null; 2514 2537 } 2515 2538 … … 2947 2970 m_strHomeFolder = virtualBox().GetHomeFolder(); 2948 2971 2949 /* Re-initialize guest OS Type database: */2972 /* Re-initialize guest OS type database: */ 2950 2973 if (m_pGuestOSTypeManager) 2951 2974 m_pGuestOSTypeManager->reCacheGuestOSTypes(m_comVBox.GetGuestOSTypes()); 2975 2952 2976 /* Mark wrappers valid: */ 2953 2977 m_fWrappersValid = true; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r101383 r102274 314 314 /** @} */ 315 315 316 /** @name COM: Guest OS Type stuff.317 * @{ */318 const UIGuestOSTypeManager &guestOSTypeManager() const { return *m_pGuestOSTypeManager; }319 /** @} */320 321 316 /** @name COM: Virtual Machine stuff. 322 317 * @{ */ … … 354 349 const QString &strProfileName, 355 350 const CCloudMachine &comMachine); 351 /** @} */ 352 353 /** @name COM: Guest OS type stuff. 354 * @{ */ 355 const UIGuestOSTypeManager &guestOSTypeManager(); 356 356 /** @} */ 357 357 … … 730 730 /** Holds whether VBoxSVC is currently available. */ 731 731 bool m_fVBoxSVCAvailable; 732 733 UIGuestOSTypeManager *m_pGuestOSTypeManager;734 732 /** @} */ 735 733 … … 742 740 /** @} */ 743 741 742 /** @name Guest OS type related stuff. 743 * @{ */ 744 /** Holds the guest OS type manager instance. */ 745 UIGuestOSTypeManager *m_pGuestOSTypeManager; 746 /** @} */ 747 744 748 /** @name Media related stuff. 745 749 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.