Blame SOURCES/0002-vcl-add-isInitVCL-to-not-initialize-twice.patch

f325b2
From ae536d948c00a5561f7d08f2f7459516d8bf9807 Mon Sep 17 00:00:00 2001
f325b2
From: Henry Castro <hcastro@collabora.com>
f325b2
Date: Mon, 7 Sep 2015 17:33:09 -0400
f325b2
Subject: [PATCH 2/6] vcl: add isInitVCL, to not initialize twice
f325b2
f325b2
In the preinit stage, the VCL is initialized in the parent process
f325b2
and when the lo_startmain thread is started, the thread initialize
f325b2
VCL again.
f325b2
f325b2
It is not necessary to initialize twice.
f325b2
f325b2
Change-Id: I819cf0125afe7760c3f4d91c420d36a3a383902c
f325b2
(cherry picked from commit bc8dfe47596f28ff43ec01af4487a2abe349caee)
f325b2
---
f325b2
 vcl/source/app/svmain.cxx | 12 +++++++++++-
f325b2
 1 file changed, 11 insertions(+), 1 deletion(-)
f325b2
f325b2
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
f325b2
index 3202019..f6d4e25 100644
f325b2
--- a/vcl/source/app/svmain.cxx
f325b2
+++ b/vcl/source/app/svmain.cxx
f325b2
@@ -91,6 +91,8 @@
f325b2
 
f325b2
 using namespace ::com::sun::star;
f325b2
 
f325b2
+static bool isInitVCL();
f325b2
+
f325b2
 oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
f325b2
 {
f325b2
     static bool bIn = false;
f325b2
@@ -160,7 +162,7 @@ int ImplSVMain()
f325b2
 
f325b2
     int nReturn = EXIT_FAILURE;
f325b2
 
f325b2
-    bool bInit = InitVCL();
f325b2
+    bool bInit = (!isInitVCL() ? InitVCL() : true);
f325b2
 
f325b2
     if( bInit )
f325b2
     {
f325b2
@@ -243,6 +245,14 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Nam
f325b2
     return retVal;
f325b2
 }
f325b2
 
f325b2
+static bool isInitVCL()
f325b2
+{
f325b2
+    ImplSVData* pSVData = ImplGetSVData();
f325b2
+    return  pExceptionHandler != NULL &&
f325b2
+            pSVData->mpApp != NULL &&
f325b2
+            pSVData->mpDefInst != NULL;
f325b2
+}
f325b2
+
f325b2
 bool InitVCL()
f325b2
 {
f325b2
     if( pExceptionHandler != NULL )
f325b2
-- 
f325b2
2.9.3
f325b2