summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-07-16 15:56:49 +0100
committerMichael Meeks <michael.meeks@collabora.com>2014-07-16 16:02:33 +0100
commit9aeadc76a4f2c878f83f07959d9d1694ff13fddf (patch)
tree9371d4ef9ac5a37621c14cdf5ef7725a83ca23d5 /writerfilter
parentc04a0895df86f40faef1bc093f7010f374df9d0b (diff)
Cleanup intrusive_ptr usage temporarily.
When we update boost, we should use boost::intrusive_ref_counter in non-threadsafe mode instead here. Change-Id: Id63610bf14d7fcb7f681e009a5ac6e4f8e077a81
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.cxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.hxx21
2 files changed, 8 insertions, 15 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx
index c45b4f508017..eb5e4b43f864 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -102,8 +102,8 @@ OOXMLFactory::Pointer_t OOXMLFactory::m_Instance;
OOXMLFactory::OOXMLFactory()
{
// multi-thread-safe mutex for all platforms
-
osl::MutexGuard aGuard(OOXMLFactory_Mutex::get());
+ mnRefCnt = 0;
}
OOXMLFactory::~OOXMLFactory()
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx b/writerfilter/source/ooxml/OOXMLFactory.hxx
index 405e47af9c80..0150acb60d0d 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -148,16 +148,8 @@ public:
void endAction(OOXMLFastContextHandler * pHandler, Token_t nToken);
virtual ~OOXMLFactory();
- inline void IncRef() const{osl_atomic_increment(&mnRefCnt);}
- inline void DecRef() const
- {
- if (!osl_atomic_decrement(&mnRefCnt))
- const_cast<OOXMLFactory*>(this)->Delete();
- }
- inline void Delete() {delete this;}
- inline oslInterlockedCount GetRef() const { return mnRefCnt; }
-protected:
- mutable oslInterlockedCount mnRefCnt; // reference count
+public:
+ sal_uInt32 mnRefCnt;
private:
static Pointer_t m_Instance;
@@ -170,13 +162,14 @@ private:
Token_t Element);
};
- inline void intrusive_ptr_add_ref(const OOXMLFactory* p)
+ inline void intrusive_ptr_add_ref(OOXMLFactory* p)
{
- p->IncRef();
+ p->mnRefCnt++;
}
- inline void intrusive_ptr_release(const OOXMLFactory* p)
+ inline void intrusive_ptr_release(OOXMLFactory* p)
{
- p->DecRef();
+ if (!(--p->mnRefCnt))
+ delete p;
}
}
}