diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-08 15:15:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-08 15:16:48 +0200 |
commit | f692c88e6062889aa12bf6cd7a71f63d177a37c4 (patch) | |
tree | 760580168eee3bfcfc86bc6a1865822ee9808119 | |
parent | 48cc4f1b8cf06a8e56c12e659a71f72d609568cd (diff) |
use SimpleReferenceObject in comphelper module
to replace hand-rolled version
Change-Id: Ie4e66d2f1f893c04be589877ef53f470ca74c9eb
-rw-r--r-- | comphelper/source/misc/asyncnotification.cxx | 18 | ||||
-rw-r--r-- | framework/Library_fwe.mk | 1 | ||||
-rw-r--r-- | include/comphelper/asyncnotification.hxx | 9 |
3 files changed, 3 insertions, 25 deletions
diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx index a8c018cd3ce1..dafe1a79d314 100644 --- a/comphelper/source/misc/asyncnotification.cxx +++ b/comphelper/source/misc/asyncnotification.cxx @@ -38,7 +38,6 @@ namespace comphelper AnyEvent::AnyEvent() - :m_refCount( 0 ) { } @@ -48,23 +47,6 @@ namespace comphelper } - oslInterlockedCount SAL_CALL AnyEvent::acquire() - { - return osl_atomic_increment( &m_refCount ); - } - - - oslInterlockedCount SAL_CALL AnyEvent::release() - { - if ( 0 == osl_atomic_decrement( &m_refCount ) ) - { - delete this; - return 0; - } - return m_refCount; - } - - //= ProcessableEvent struct ProcessableEvent diff --git a/framework/Library_fwe.mk b/framework/Library_fwe.mk index ab5f460bc67a..ee086543aafc 100644 --- a/framework/Library_fwe.mk +++ b/framework/Library_fwe.mk @@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,fwe,\ cppuhelper \ fwi \ sal \ + salhelper \ i18nlangtag \ svl \ svt \ diff --git a/include/comphelper/asyncnotification.hxx b/include/comphelper/asyncnotification.hxx index 19f9fa850145..93209768e778 100644 --- a/include/comphelper/asyncnotification.hxx +++ b/include/comphelper/asyncnotification.hxx @@ -27,6 +27,7 @@ #include <rtl/ref.hxx> #include <sal/types.h> #include <salhelper/thread.hxx> +#include <salhelper/simplereferenceobject.hxx> namespace comphelper @@ -38,17 +39,11 @@ namespace comphelper /** the very basic instance to hold a description of an event */ - class COMPHELPER_DLLPUBLIC AnyEvent : ::rtl::IReference + class COMPHELPER_DLLPUBLIC AnyEvent : public salhelper::SimpleReferenceObject { - private: - oslInterlockedCount m_refCount; - public: AnyEvent(); - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - protected: virtual ~AnyEvent(); |