From cda690620566a129bb474a0071bde670064a51ec Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 20 Jan 2020 19:34:34 +0000 Subject: lok: disable ucbgio provider for Online. Of course, some lok apps may want the provider, but it creates unwanted threads causing problems with forkit in some cases. Change-Id: I7d19d629b3657780b52c3c753a4c8dcba6ae86b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87098 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks --- ucb/source/ucp/gio/gio_provider.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ucb') diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx index 912de0e8e008..221c229ff69a 100644 --- a/ucb/source/ucp/gio/gio_provider.cxx +++ b/ucb/source/ucp/gio/gio_provider.cxx @@ -115,11 +115,25 @@ ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider ); } +// gio creates threads we don't want in online's forkit +static bool isDisabled() +{ + const char *pDisable = getenv("UNODISABLELIBRARY"); + if (!pDisable) + return false; + OString aDisable(pDisable, strlen(pDisable)); + return aDisable.indexOf("ucpgio1") >= 0; +} + extern "C" SAL_DLLPUBLIC_EXPORT void * ucpgio1_component_getFactory( const sal_Char *pImplName, void *pServiceManager, void * ) { void * pRet = nullptr; + static bool bDisabled = isDisabled(); + if (bDisabled) + return nullptr; + css::uno::Reference< css::lang::XMultiServiceFactory > xSMgr (static_cast< css::lang::XMultiServiceFactory * >( pServiceManager ) ); css::uno::Reference< css::lang::XSingleServiceFactory > xFactory; -- cgit