[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - include/vcl toolkit/source vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 13 15:13:04 UTC 2019


 include/vcl/svapp.hxx              |    3 +++
 toolkit/source/awt/vclxtoolkit.cxx |    2 +-
 vcl/source/app/svmain.cxx          |    8 +++-----
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit dbc6cffff20ebf5f0cb933d884ac9de404740898
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 13 12:03:20 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 13 17:12:26 2019 +0200

    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/73957
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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 f597f94c86fd..d67136924f17 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;


More information about the Libreoffice-commits mailing list