From fb123f93f9f5ce42c8e5785d2f8e0edaf951740e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 26 Mar 2014 19:21:20 +0000 Subject: Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2. --- .../xpcom18a4/xpcom/components/nsComponentManager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp') diff --git a/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp b/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp index 681030a0..ec3cb3f5 100644 --- a/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp +++ b/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp @@ -2375,7 +2375,7 @@ nsComponentManagerImpl::GetServiceByContractID(const char* aContractID, mon.Enter(); -#ifdef XPCOM_CHECK_PENDING_CIDS +#ifdef XPCOM_CHECK_PENDING_CIDS if (entry) RemovePendingCID(entry->mCid); #endif @@ -3722,8 +3722,21 @@ NS_GetServiceManager(nsIServiceManager* *result) if (nsComponentManagerImpl::gComponentManager == nsnull) { +#ifdef VBOX + // While XPCOM might need initialization, we're not in a position + // to pass the right values to this call. This is actually triggered + // on object destruction, so there is no point in re-initializing, + // and actually the attempt would lead to nested calls to + // xptiInterfaceInfoManager::BuildFileSearchPath, which it detects + // as unsafe in debug builds. Just fail, no real problem. +#ifdef DEBUG + printf("NS_GetServiceManager: no current instance, suppressed XPCOM initialization!\n"); +#endif + rv = NS_ERROR_SERVICE_NOT_AVAILABLE; +#else /* !VBOX */ // XPCOM needs initialization. rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); +#endif /* !VBOX */ } if (NS_FAILED(rv)) -- cgit v1.2.1