Kaydet (Commit) f692c88e authored tarafından Noel Grandin's avatar Noel Grandin

use SimpleReferenceObject in comphelper module

to replace hand-rolled version

Change-Id: Ie4e66d2f1f893c04be589877ef53f470ca74c9eb
üst 48cc4f1b
...@@ -38,7 +38,6 @@ namespace comphelper ...@@ -38,7 +38,6 @@ namespace comphelper
AnyEvent::AnyEvent() AnyEvent::AnyEvent()
:m_refCount( 0 )
{ {
} }
...@@ -48,23 +47,6 @@ namespace comphelper ...@@ -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 //= ProcessableEvent
struct ProcessableEvent struct ProcessableEvent
......
...@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,fwe,\ ...@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,fwe,\
cppuhelper \ cppuhelper \
fwi \ fwi \
sal \ sal \
salhelper \
i18nlangtag \ i18nlangtag \
svl \ svl \
svt \ svt \
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <sal/types.h> #include <sal/types.h>
#include <salhelper/thread.hxx> #include <salhelper/thread.hxx>
#include <salhelper/simplereferenceobject.hxx>
namespace comphelper namespace comphelper
...@@ -38,17 +39,11 @@ namespace comphelper ...@@ -38,17 +39,11 @@ namespace comphelper
/** the very basic instance to hold a description of an event /** 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: public:
AnyEvent(); AnyEvent();
virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
protected: protected:
virtual ~AnyEvent(); virtual ~AnyEvent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment