summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/doc/objxtor.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index a3745783c1db..409ce93bb900 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -354,7 +354,7 @@ SfxObjectShell::~SfxObjectShell()
// Never call GetInPlaceObject(), the access to the derivative branch
// SfxInternObject is not allowed because of a compiler bug
- SfxObjectShell::Close();
+ SfxObjectShell::CloseInternal();
pImp->pBaseModel.set( NULL );
DELETEX(AutoReloadTimer_Impl, pImp->pReloadTimer );
@@ -438,6 +438,12 @@ void SfxObjectShell::ViewAssigned()
bool SfxObjectShell::Close()
{
SfxObjectShellRef aRef(this);
+ return CloseInternal();
+}
+
+// variant that does not take a reference to itself, so we can call it during object destruction
+bool SfxObjectShell::CloseInternal()
+{
if ( !pImp->bClosing )
{
// Do not close if a progress is still running