[Libreoffice-commits] core.git: Branch 'feature/calctiledrendering4' - 2 commits - desktop/source

Andrzej Hunt andrzej.hunt at collabora.com
Fri Jul 18 04:14:15 PDT 2014


 desktop/source/app/officeipcthread.cxx |    5 +++++
 desktop/source/app/officeipcthread.hxx |    1 +
 desktop/source/lib/init.cxx            |    9 +++++++++
 3 files changed, 15 insertions(+)

New commits:
commit c6b92e247d731add78b39c0aab2ec7c8d15484b7
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Fri Jul 18 13:12:25 2014 +0200

    Fail LOK initialisation if restart is required.
    
    Change-Id: Ia13a3523666147f002b5a5177fd6962d55556f56

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76d05f3..567f5ae 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -661,6 +661,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
         pthread_create(&thread, 0, lo_startmain, NULL);
         OfficeIPCThread::WaitForReady();
 
+        // If the Thread has been disabled again that indicates that a
+        // restart is required (or in any case we don't have a useable
+        // process around).
+        if (!OfficeIPCThread::IsEnabled())
+        {
+            fprintf(stderr, "LOK init failed -- restart required\n");
+            return false;
+        }
+
         Application::EnableHeadlessMode(true);
 
         ErrorHandler::RegisterDisplay(aBasicErrorFunc);
commit 2ac0db5fdd203e5aab1a67ecce244d1d9ccb98d3
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Fri Jul 18 13:10:14 2014 +0200

    Add OfficeIPCThread::IsEnabled.
    
    This lets us easily check whether Desktop::Main has shut down,
    i.e. which happens on the first restart-requiring initialisation.
    
    Change-Id: I7fe5699a4bf59e2c3b891ac73abd9b147773d22e

diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 93cd339..eaacf81 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -681,6 +681,11 @@ void OfficeIPCThread::WaitForReady(
     }
 }
 
+bool OfficeIPCThread::IsEnabled()
+{
+    return pGlobalOfficeIPCThread.is();
+}
+
 void OfficeIPCThread::execute()
 {
 #if HAVE_FEATURE_DESKTOP
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index 9c1d751..8ed40fd 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -128,6 +128,7 @@ class OfficeIPCThread : public salhelper::Thread
     static void                 WaitForReady(
         rtl::Reference< OfficeIPCThread > const & pThread =
             rtl::Reference< OfficeIPCThread >());
+    static bool                 IsEnabled();
 
     bool                        AreRequestsEnabled() const { return mbRequestsEnabled && ! mbDowning; }
 };


More information about the Libreoffice-commits mailing list