diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-06-20 23:38:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-24 12:05:09 +0000 |
commit | 136a2fd6c08193793d546e69108765316c96668b (patch) | |
tree | 1e78b7cbb60c0726d4c13ac171b973eff6978466 /basic | |
parent | 7d76bb251e0c88ff17282a33b801a5d17a434af5 (diff) |
compilerplugins: add OWeakObject::release() override check
Change-Id: I767857545d7c91615cf162790c04f0016de9fdf6
Reviewed-on: https://gerrit.libreoffice.org/26555
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index ef6a6797c93b..7970f04b79b6 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -175,21 +175,14 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV void SAL_CALL DocObjectWrapper::acquire() throw () { - osl_atomic_increment( &m_refCount ); + OWeakObject::acquire(); SAL_INFO("basic","DocObjectWrapper::acquire("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount ); } void SAL_CALL DocObjectWrapper::release() throw () { - if ( osl_atomic_decrement( &m_refCount ) == 0 ) - { - SAL_INFO("basic","DocObjectWrapper::release("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount ); - delete this; - } - else - { - SAL_INFO("basic","DocObjectWrapper::release("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " refcount is now " << m_refCount ); - } + SAL_INFO("basic","DocObjectWrapper::release("<< OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr() << ") 0x" << this << " decrementing refcount, was " << m_refCount ); + OWeakObject::release(); } DocObjectWrapper::~DocObjectWrapper() |