diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-07 16:00:31 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-08 05:32:56 +0200 |
commit | f3fc127dc007f32355859ae4fc7d34916c500a18 (patch) | |
tree | 799ee5af2c1a31c6c2243444caa932a6b2520e1b /comphelper | |
parent | 817e3447053d1a7465a5cf547b4eb39fc46b4d59 (diff) |
Use osl_atomic_increment/osl_atomic_decrement to change m_refCount
Change-Id: Ia24441d3671102fdeeb797547396c25ee2a6ffd3
Reviewed-on: https://gerrit.libreoffice.org/70382
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/enumhelper.cxx | 16 | ||||
-rw-r--r-- | comphelper/source/misc/instancelocker.cxx | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/comphelper/source/container/enumhelper.cxx b/comphelper/source/container/enumhelper.cxx index 41585ae24a8a..dc467bb23fa8 100644 --- a/comphelper/source/container/enumhelper.cxx +++ b/comphelper/source/container/enumhelper.cxx @@ -105,14 +105,14 @@ void OEnumerationByName::impl_startDisposeListening() if (m_bListening) return; - ++m_refCount; + osl_atomic_increment(&m_refCount); css::uno::Reference< css::lang::XComponent > xDisposable(m_xAccess, css::uno::UNO_QUERY); if (xDisposable.is()) { xDisposable->addEventListener(this); m_bListening = true; } - --m_refCount; + osl_atomic_decrement(&m_refCount); } @@ -123,14 +123,14 @@ void OEnumerationByName::impl_stopDisposeListening() if (!m_bListening) return; - ++m_refCount; + osl_atomic_increment(&m_refCount); css::uno::Reference< css::lang::XComponent > xDisposable(m_xAccess, css::uno::UNO_QUERY); if (xDisposable.is()) { xDisposable->removeEventListener(this); m_bListening = false; } - --m_refCount; + osl_atomic_decrement(&m_refCount); } OEnumerationByIndex::OEnumerationByIndex(const css::uno::Reference< css::container::XIndexAccess >& _rxAccess) @@ -201,14 +201,14 @@ void OEnumerationByIndex::impl_startDisposeListening() if (m_bListening) return; - ++m_refCount; + osl_atomic_increment(&m_refCount); css::uno::Reference< css::lang::XComponent > xDisposable(m_xAccess, css::uno::UNO_QUERY); if (xDisposable.is()) { xDisposable->addEventListener(this); m_bListening = true; } - --m_refCount; + osl_atomic_decrement(&m_refCount); } @@ -219,14 +219,14 @@ void OEnumerationByIndex::impl_stopDisposeListening() if (!m_bListening) return; - ++m_refCount; + osl_atomic_increment(&m_refCount); css::uno::Reference< css::lang::XComponent > xDisposable(m_xAccess, css::uno::UNO_QUERY); if (xDisposable.is()) { xDisposable->removeEventListener(this); m_bListening = false; } - --m_refCount; + osl_atomic_decrement(&m_refCount); } OAnyEnumeration::OAnyEnumeration(const css::uno::Sequence< css::uno::Any >& lItems) diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index c995499d8410..cf7a2cfaf218 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -50,7 +50,7 @@ OInstanceLocker::~OInstanceLocker() { if ( !m_bDisposed ) { - m_refCount++; // to call dispose + osl_atomic_increment(&m_refCount); // to call dispose try { dispose(); } |