diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-10-28 21:22:24 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-28 22:49:28 +0200 |
commit | 855e69d37eec08efdf9952ec3fb5424cf69e9f54 (patch) | |
tree | 03ea085da1382b0e2fbf0c570fe094c52b48c2ba | |
parent | 3d456dfa6637c6c3ebe7a21f1f1a5b05039cee2a (diff) |
svl: SfxPoolItem reference counting assertions
Change-Id: Ice2ec9a4592a1fad36913ae7d089aa8c63dfc669
-rw-r--r-- | include/svl/poolitem.hxx | 8 | ||||
-rw-r--r-- | svl/source/items/poolitem.cxx | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index cf7c96ec65ba..cbc60a952c5c 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -192,15 +192,15 @@ inline void SfxPoolItem::SetKind( SfxItemKind n ) inline void SfxPoolItem::AddRef( sal_uLong n ) const { - DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "AddRef with non-Pool-Item"); - DBG_ASSERT(ULONG_MAX - m_nRefCount > n, "AddRef: refcount overflow"); + assert(m_nRefCount <= SFX_ITEMS_MAXREF && "AddRef with non-Pool-Item"); + assert(n <= SFX_ITEMS_MAXREF - m_nRefCount && "AddRef: refcount overflow"); m_nRefCount += n; } inline sal_uLong SfxPoolItem::ReleaseRef( sal_uLong n ) const { - DBG_ASSERT(m_nRefCount <= SFX_ITEMS_MAXREF, "ReleaseRef with non-Pool-Item"); - DBG_ASSERT(m_nRefCount >= n, "ReleaseRef: refcount underflow"); + assert(m_nRefCount <= SFX_ITEMS_MAXREF && "ReleaseRef with non-Pool-Item"); + assert(n <= m_nRefCount); m_nRefCount -= n; return m_nRefCount; } diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 0032ac6c5ad0..a1afa3407f4c 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -110,8 +110,8 @@ SfxPoolItem::SfxPoolItem( const SfxPoolItem& rCpy ) SfxPoolItem::~SfxPoolItem() { - DBG_ASSERT(m_nRefCount == 0 || m_nRefCount > SFX_ITEMS_MAXREF, - "destroying item in use"); + assert((m_nRefCount == 0 || m_nRefCount > SFX_ITEMS_MAXREF) + && "destroying item in use"); #if OSL_DEBUG_LEVEL > 0 --nItemCount; #endif |