desktop/source/offacc/acceptor.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 01f0676b9517af903abd7da041d8219e5df25eeb
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Dec 6 15:43:19 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Dec 14 22:46:42 2024 +0100

    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.mcnam...@collabora.com>

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&) {

Reply via email to