From 7cf55abcfe37a5ba76960b56c9b406cec380213d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Dec 2024 15:43:19 +0000 Subject: cid#1608560 Data race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3b579434727e8b51d0de136c83d891c2f409d77a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178482 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 01f0676b9517af903abd7da041d8219e5df25eeb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178540 Reviewed-by: Xisco Fauli --- desktop/source/offacc/acceptor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'desktop/source') 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&) { -- cgit