summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-01-20 19:34:34 +0000
committerMichael Meeks <michael.meeks@collabora.com>2020-01-21 09:17:24 +0100
commitcacb3861ab9c06fec02189f26f9f3988c0b6cdbe (patch)
treec7211b3e00c76774de5b19efd1713d4ca393d182 /ucb
parentee32c3e50d2dffa4b41e11e7304b433c430eeb51 (diff)
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/+/87111 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/gio/gio_provider.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx
index e9986207971f..92302c2caedf 100644
--- a/ucb/source/ucp/gio/gio_provider.cxx
+++ b/ucb/source/ucp/gio/gio_provider.cxx
@@ -115,14 +115,29 @@ 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 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;
+
#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
#endif