diff options
-rw-r--r-- | ucb/source/ucp/gio/gio_provider.cxx | 15 |
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 |