summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/weak.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index a11e52bbbb78..06c6ed178def 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -100,6 +100,10 @@ Any SAL_CALL OWeakConnectionPoint::queryInterface( const Type & rType )
// XInterface
void SAL_CALL OWeakConnectionPoint::acquire() throw()
{
+#ifdef DBG_UTIL
+ // catch things early which have been deleted and then re-acquired
+ assert(m_aRefCount != -1);
+#endif
osl_atomic_increment( &m_aRefCount );
}
@@ -107,7 +111,12 @@ void SAL_CALL OWeakConnectionPoint::acquire() throw()
void SAL_CALL OWeakConnectionPoint::release() throw()
{
if (! osl_atomic_decrement( &m_aRefCount ))
+ {
+#ifdef DBG_UTIL
+ m_aRefCount = -1;
+#endif
delete this;
+ }
}
void OWeakConnectionPoint::dispose()