cpputools/source/unoexe/unoexe.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit c2dda4579d6b80526cd19cf97ea6cf6237e590c9
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Oct 17 08:46:32 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Oct 17 20:25:15 2024 +0200

    cid#1555171 Data race condition
    
    Change-Id: Ibb49dbd5ce386c4e31c1dfbacb23477d1a08a5ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175069
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/cpputools/source/unoexe/unoexe.cxx 
b/cpputools/source/unoexe/unoexe.cxx
index 58240e6f38e4..c7791538d3b6 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -296,13 +296,9 @@ Reference< XInterface > OInstanceProvider::getInstance( 
const OUString & rName )
             }
             else if (_bSingleInstance)
             {
-                {
-                    std::lock_guard aGuard( _aSingleInstanceMutex );
-                    if (! _xSingleInstance.is())
-                    {
-                        _xSingleInstance = createInstance();
-                    }
-                }
+                std::lock_guard aGuard(_aSingleInstanceMutex);
+                if (!_xSingleInstance.is())
+                    _xSingleInstance = createInstance();
                 xRet = _xSingleInstance;
             }
             else

Reply via email to