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 /embeddedobj | |
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 'embeddedobj')
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 2 | ||||
-rw-r--r-- | embeddedobj/source/general/docholder.cxx | 6 | ||||
-rw-r--r-- | embeddedobj/source/msole/olemisc.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index 912cf3a80611..48da9abdeaf7 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -261,7 +261,7 @@ OCommonEmbeddedObject::~OCommonEmbeddedObject() { if ( m_pInterfaceContainer || m_xDocHolder.is() ) { - m_refCount++; + osl_atomic_increment(&m_refCount); try { lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >( this ) ); diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index 75f61282fcc2..997a6105e33a 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -173,7 +173,7 @@ DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& m_aOutplaceFrameProps[1] <<= aArg; uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( m_xContext ); - m_refCount++; + osl_atomic_increment(&m_refCount); try { xDesktop->addTerminateListener( this ); @@ -181,7 +181,7 @@ DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& catch ( const uno::Exception& ) { } - m_refCount--; + osl_atomic_decrement(&m_refCount); aArg.Name = "ParentFrame"; aArg.Value <<= xDesktop; //TODO/LATER: should use parent document frame @@ -191,7 +191,7 @@ DocumentHolder::DocumentHolder( const uno::Reference< uno::XComponentContext >& DocumentHolder::~DocumentHolder() { - m_refCount++; // to allow deregistration as a listener + osl_atomic_increment(&m_refCount); // to allow deregistration as a listener if( m_xFrame.is() ) CloseFrame(); diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx index 3225b7666953..9a22ec9982cb 100644 --- a/embeddedobj/source/msole/olemisc.cxx +++ b/embeddedobj/source/msole/olemisc.cxx @@ -142,7 +142,7 @@ OleEmbeddedObject::~OleEmbeddedObject() if ( m_pOleComponent || m_pInterfaceContainer || m_xObjectStream.is() ) { // the component must be cleaned during closing - m_refCount++; // to avoid crash + osl_atomic_increment(&m_refCount); // to avoid crash try { Dispose(); } catch( const uno::Exception& ) {} |