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 /sw/source | |
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 'sw/source')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbtree.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/uivwimp.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unodispatch.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxvw.cxx | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index d8be8a2b5b53..0c406018e557 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -904,10 +904,10 @@ SwXShape::SwXShape(uno::Reference<uno::XInterface> & xShape, } } xShape = nullptr; - m_refCount++; + osl_atomic_increment(&m_refCount); if( xShapeAgg.is() ) xShapeAgg->setDelegator( static_cast<cppu::OWeakObject*>(this) ); - m_refCount--; + osl_atomic_decrement(&m_refCount); uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY); SvxShape* pShape = nullptr; diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index a0fb9e06af4d..f5d6c5c64dea 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -83,13 +83,13 @@ SwDBTreeList_Impl::~SwDBTreeList_Impl() { if(m_xDatabaseContext.is()) { - m_refCount++; + osl_atomic_increment(&m_refCount); //block necessary due to solaris' compiler behaviour to //remove temporaries at the block's end { m_xDatabaseContext->removeContainerListener( this ); } - m_refCount--; + osl_atomic_decrement(&m_refCount); } } diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 6c81a7072b73..f2d9fdcf420f 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -224,7 +224,7 @@ void SwView_Impl::Invalidate() void SwView_Impl::AddTransferable(SwTransferable& rTransferable) { //prevent removing of the non-referenced SwTransferable - rTransferable.m_refCount++; + osl_atomic_increment(&rTransferable.m_refCount); { // Remove previously added, but no longer existing weak references. mxTransferables.erase(std::remove_if(mxTransferables.begin(), mxTransferables.end(), @@ -235,7 +235,7 @@ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) mxTransferables.emplace_back(uno::Reference<lang::XUnoTunnel>(&rTransferable)); } - rTransferable.m_refCount--; + osl_atomic_decrement(&rTransferable.m_refCount); } void SwView_Impl::StartDocumentInserter( diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index 9facfa8ea404..c97431bc9c45 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -46,14 +46,14 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_xIntercepted.set(xUnoFrame, uno::UNO_QUERY); if(m_xIntercepted.is()) { - m_refCount++; + osl_atomic_increment(&m_refCount); m_xIntercepted->registerDispatchProviderInterceptor(static_cast<frame::XDispatchProviderInterceptor*>(this)); // this should make us the top-level dispatch-provider for the component, via a call to our // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fulfill uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is()) xInterceptedComponent->addEventListener(static_cast<lang::XEventListener*>(this)); - m_refCount--; + osl_atomic_decrement(&m_refCount); } } diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index dd4b8c148d32..2be21959a05a 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -120,7 +120,7 @@ void SwXTextView::Invalidate() mxTextViewCursor.clear(); } - m_refCount++; //prevent second d'tor call + osl_atomic_increment(&m_refCount); //prevent second d'tor call { uno::Reference<uno::XInterface> const xInt(static_cast< @@ -129,7 +129,7 @@ void SwXTextView::Invalidate() m_SelChangedListeners.disposeAndClear(aEvent); } - m_refCount--; + osl_atomic_decrement(&m_refCount); m_pView = nullptr; } |