From 666f8651b117f6124b7308586284102f798215ef Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 11 Jul 2014 08:58:37 +0200 Subject: 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 --- tools/source/ref/ref.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') 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; } -- cgit v1.2.3