summaryrefslogtreecommitdiff
path: root/xmlhelp/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-02-22 13:40:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-02-22 13:12:04 +0000
commit47cd9b65efa662719950866ab9c45fb3f130e1b4 (patch)
treee6b8c286621f24b94dbaa22a07203db95961f22f /xmlhelp/source
parent7cfe7f23efb97f6b42dcb1589b3d66d4b881092d (diff)
fix deadlock in xmlhelper::Databases
after commit 2c37a0ca31095165d05740a2ff4969f625b4a75b Author: Noel Grandin <noel.grandin@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.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp/source')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx11
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx1
2 files changed, 9 insertions, 3 deletions
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;