include/comphelper/singletonref.hxx |    2 --
 1 file changed, 2 deletions(-)

New commits:
commit bdfd8d5ab2c30b2c85bbf4354678d60811ae3998
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Feb 16 09:04:00 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 16 08:25:29 2023 +0000

    no need to lock when accessing m_pInstance here
    
    as noted by mkaganski, this field is valid until the object destructs,
    so no need to take a lock
    
    Change-Id: Id0b9a1a26391d4e971bd0b37b9d6e1b1a20e163a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147136
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/comphelper/singletonref.hxx 
b/include/comphelper/singletonref.hxx
index 5e90fc78cdc1..7e9e85522562 100644
--- a/include/comphelper/singletonref.hxx
+++ b/include/comphelper/singletonref.hxx
@@ -125,7 +125,6 @@ public:
     SingletonClass* operator->() const
     {
         // GLOBAL SAFE ->
-        std::unique_lock aLock(SingletonRef::ownStaticLock());
         return m_pInstance;
         // <- GLOBAL SAFE
     }
@@ -135,7 +134,6 @@ public:
     SingletonClass& operator*() const
     {
         // GLOBAL SAFE ->
-        std::unique_lock aLock(SingletonRef::ownStaticLock());
         return *m_pInstance;
         // <- GLOBAL SAFE
     }

Reply via email to