summaryrefslogtreecommitdiff
path: root/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp')
-rw-r--r--src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp15
1 files changed, 14 insertions, 1 deletions
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))