xmlhelp/source/cxxhelp/provider/databases.cxx |   11 ++++++++---
 xmlhelp/source/cxxhelp/provider/databases.hxx |    1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 47cd9b65efa662719950866ab9c45fb3f130e1b4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Feb 22 13:40:40 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Feb 22 13:12:04 2023 +0000

    fix deadlock in xmlhelper::Databases
    
    after
        commit 2c37a0ca31095165d05740a2ff4969f625b4a75b
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Tue Feb 21 15:35:20 2023 +0200
        osl::Mutex->std::mutex in xmlhelp::Databases
    
    Change-Id: I3cce9bcd9c6c9d55c5162fdfd351048d16574477
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147459
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx 
b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 256230149ec2..23ea6db661ee 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -81,7 +81,12 @@ using namespace com::sun::star::beans;
 
 OUString Databases::expandURL( const OUString& aURL )
 {
-    std::unique_lock aGuard( m_aMutex );
+    std::unique_lock aGuard(m_aMutex);
+    return expandURL(aGuard, aURL);
+}
+
+OUString Databases::expandURL( std::unique_lock<std::mutex>& /*rGuard*/, const 
OUString& aURL )
+{
     OUString aRetURL = expandURL( aURL, m_xContext );
     return aRetURL;
 }
@@ -453,7 +458,7 @@ helpdatafileproxy::Hdf* Databases::getHelpDataFile( 
std::u16string_view Database
 
         OUString fileURL;
         if( pExtensionPath )
-            fileURL = expandURL(*pExtensionPath) + Language + dbFileName;
+            fileURL = expandURL(aGuard, *pExtensionPath) + Language + 
dbFileName;
         else
             fileURL = m_aInstallDirectory + key;
 
@@ -809,7 +814,7 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( 
std::u16string_view jar
                 std::u16string_view aExtensionPath = jar.substr( 
nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 );
                 std::u16string_view aPureJar = jar.substr( nQuestionMark2 + 1 
);
 
-                zipFile = expandURL( OUString::Concat(aExtensionPath) + "/" + 
aPureJar );
+                zipFile = expandURL( aGuard, OUString::Concat(aExtensionPath) 
+ "/" + aPureJar );
             }
             else
             {
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx 
b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 4ea43c4e8146..dbf38e022e70 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -218,6 +218,7 @@ namespace chelp {
             const css::uno::Reference< css::uno::XComponentContext >& xContext 
);
 
     private:
+        OUString expandURL( std::unique_lock<std::mutex>& rGuard, const 
OUString& aURL );
         OUString processLang( std::unique_lock<std::mutex>& rGuard, const 
OUString& Language );
 
         std::mutex                                               m_aMutex;

Reply via email to