summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-06 15:43:19 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2024-12-19 11:38:09 +0100
commit7cf55abcfe37a5ba76960b56c9b406cec380213d (patch)
tree9138978a54af94043291b5214472597c77e7d3eb
parent6d68609062842b918db1188d2605aec512e09404 (diff)
cid#1608560 Data race condition
Change-Id: I3b579434727e8b51d0de136c83d891c2f409d77a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178482 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 01f0676b9517af903abd7da041d8219e5df25eeb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178540 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--desktop/source/offacc/acceptor.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx
index 2c51a73c1199..dd90a0c88526 100644
--- a/desktop/source/offacc/acceptor.cxx
+++ b/desktop/source/offacc/acceptor.cxx
@@ -104,6 +104,8 @@ void Acceptor::run()
SAL_INFO( "desktop.offacc",
"Acceptor::run now enabled and continuing");
+ std::unique_lock g(m_aMutex);
+
// accept connection
Reference< XConnection > rConnection = m_rAcceptor->accept( m_aConnectString );
// if we return without a valid connection we must assume that the acceptor
@@ -117,7 +119,6 @@ void Acceptor::run()
// create the bridge. The remote end will have a reference to this bridge
// thus preventing the bridge from being disposed. When the remote end releases
// the bridge, it will be destructed.
- std::unique_lock g(m_aMutex);
m_bridges.add(m_rBridgeFactory->createBridge(
u""_ustr, m_aProtocol, rConnection, rInstanceProvider));
} catch (const Exception&) {