summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-07-11 08:58:37 +0200
committerMichael Stahl <mstahl@redhat.com>2014-07-29 17:56:51 +0200
commit666f8651b117f6124b7308586284102f798215ef (patch)
tree7ee2a7a604d1be8ce75ccc575feb0a21ed0de571 /tools
parent94a5c8766d81c10084f69be6f576791a36ab2bc9 (diff)
simplify "no delete" logic in SvRefBase
by converting the bit munging to use bitfields. Remove unused return values. Add asserts to check that AddRef() is not called after the object is deleted. Fix the code in SfxObjectShell to not call AddRef() after SfxObjectShell is deleted. Change-Id: I3a3565a0bc45fc9d1d086222265ab8b8175818a7
Diffstat (limited to 'tools')
-rw-r--r--tools/source/ref/ref.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/source/ref/ref.cxx b/tools/source/ref/ref.cxx
index 881a25aaf528..3a6aa59f1743 100644
--- a/tools/source/ref/ref.cxx
+++ b/tools/source/ref/ref.cxx
@@ -25,7 +25,11 @@ SvRefBase::~SvRefBase()
void SvRefBase::QueryDelete()
{
- nRefCount = SV_NO_DELETE_REFCOUNT / 2;
+ bNoDelete = 0;
+ // I'm not sure about the original purpose of this line, but right now
+ // it serves the purpose that anything that attempts to do an AddRef()
+ // after an object is deleted will trip an assert.
+ nRefCount = 1 << 30;
delete this;
}