[Libreoffice-commits] core.git: ucb/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 21 08:18:05 UTC 2020


 ucb/source/ucp/gio/gio_provider.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit cacb3861ab9c06fec02189f26f9f3988c0b6cdbe
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Jan 20 19:34:34 2020 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jan 21 09:17:24 2020 +0100

    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 at collabora.com>

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


More information about the Libreoffice-commits mailing list