summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-09-07 17:33:09 -0400
committerTor Lillqvist <tml@collabora.com>2016-02-15 22:43:31 +0200
commitbc8dfe47596f28ff43ec01af4487a2abe349caee (patch)
tree53953c5009bce83960fbbbfc21bc63d1782d475d /vcl/source
parent4c251ee490523675211afa0f967de2830067f9bc (diff)
vcl: add isInitVCL, to not initialize twice
In the preinit stage, the VCL is initialized in the parent process and when the lo_startmain thread is started, the thread initialize VCL again. It is not necessary to initialize twice. Change-Id: I819cf0125afe7760c3f4d91c420d36a3a383902c
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/svmain.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index eba0c10ded5b..2eb36ef4cf44 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -92,6 +92,8 @@
using namespace ::com::sun::star;
+static bool isInitVCL();
+
oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
{
static bool bIn = false;
@@ -156,7 +158,7 @@ int ImplSVMain()
int nReturn = EXIT_FAILURE;
- bool bInit = InitVCL();
+ bool bInit = (!isInitVCL() ? InitVCL() : true);
if( bInit )
{
@@ -239,6 +241,14 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Nam
return retVal;
}
+static bool isInitVCL()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ return pExceptionHandler != NULL &&
+ pSVData->mpApp != NULL &&
+ pSVData->mpDefInst != NULL;
+}
+
bool InitVCL()
{
if( pExceptionHandler != nullptr )