diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-06-13 12:03:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-06-13 15:12:44 +0200 |
commit | 21f52ffd77f68d345949f212ad7d622502bd21e9 (patch) | |
tree | 90fb1fbae47b150f4719c101bab020dd4c8461c4 | |
parent | Access2Base - Robustness changes (diff) | |
download | core-21f52ffd77f68d345949f212ad7d622502bd21e9.tar.gz core-21f52ffd77f68d345949f212ad7d622502bd21e9.zip |
unopkg gui crashes on shutdown
since...
commit e655dc8bbf010e5ef89c32c2ebde56281b323925
Date: Thu May 9 18:24:18 2019 +0100
unipoll: let InitVCL tolerate double init.
which changed InitVCL to return true if it was
already initialized, tricking toolkit into thinking
it was the first one to call InitVCL
Change-Id: I33552a5e2caca909f8d63fbf5f23b9fbc4c2dfbd
Reviewed-on: https://gerrit.libreoffice.org/73956
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/vcl/svapp.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 8 |
3 files changed, 7 insertions, 6 deletions
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d89a23e54a13..8fc5d0d46ccb 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1482,6 +1482,9 @@ public: VCL_DLLPUBLIC Application* GetpApp(); +// returns true if vcl is already initialized +VCL_DLLPUBLIC bool IsVCLInit(); +// returns true if vcl successfully initializes or was already initialized VCL_DLLPUBLIC bool InitVCL(); VCL_DLLPUBLIC void DeInitVCL(); diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 398b5b77cfc4..e09dee3d242c 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -877,7 +877,7 @@ static void ToolkitWorkerFunction( void* pArgs ) } VCLXToolkit * pTk = static_cast<VCLXToolkit *>(pArgs); - bInitedByVCLToolkit = InitVCL(); + bInitedByVCLToolkit = !IsVCLInit() && InitVCL(); if( bInitedByVCLToolkit ) { UnoWrapper* pUnoWrapper = new UnoWrapper( pTk ); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 16b83439751b..51e47674b604 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -112,8 +112,6 @@ using namespace ::com::sun::star; static bool g_bIsLeanException; -static bool isInitVCL(); - static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo) { static volatile bool bIn = false; @@ -190,7 +188,7 @@ int ImplSVMain() int nReturn = EXIT_FAILURE; - const bool bWasInitVCL = isInitVCL(); + const bool bWasInitVCL = IsVCLInit(); const bool bInit = bWasInitVCL || InitVCL(); int nRet = 0; if (!bWasInitVCL && bInit && pSVData->mpDefInst->SVMainHook(&nRet)) @@ -273,7 +271,7 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Nam return retVal; } -static bool isInitVCL() +bool IsVCLInit() { ImplSVData* pSVData = ImplGetSVData(); return pExceptionHandler != nullptr && @@ -294,7 +292,7 @@ namespace vclmain bool InitVCL() { - if (isInitVCL()) + if (IsVCLInit()) { SAL_INFO("vcl.app", "Double initialization of vcl"); return true; |