summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2012-06-21 07:27:44 +0000
committerEike Rathke <erack@redhat.com>2013-03-15 20:25:57 +0100
commit55dd17942cde0a1dd50fb534cff415adbc0b6a5e (patch)
tree899f3426fa3cbf6c51eaaf7caf8d2a9408169a87 /svl
parent2ded844730e178b71183988e9078881a8c43dded (diff)
i#120055 Prevent crash caused by un-disposed secondary item pool.
Conflicts: svl/source/items/itempool.cxx Adapted to new pImp implementation. (erAck) Change-Id: I106f0dc41bc8f41d394d680fe89a8fee6a2f508a
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/itempool.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 13b3b2aaa4be..54593b34be82 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -338,10 +338,21 @@ void SfxItemPool::ReleaseDefaults
SfxItemPool::~SfxItemPool()
{
DBG_DTOR(SfxItemPool, 0);
- DBG_ASSERT( pImp->mpMaster == this, "destroying active Secondary-Pool" );
if ( !pImp->maPoolItems.empty() && pImp->ppPoolDefaults )
Delete();
+
+ if (pImp->mpMaster != NULL && pImp->mpMaster != this)
+ {
+ // This condition indicates an error. A
+ // pImp->mpMaster->SetSecondaryPool(...) call should have been made
+ // earlier to prevent this. At this point we can only try to
+ // prevent a crash later on.
+ DBG_ASSERT( pImp->mpMaster == this, "destroying active Secondary-Pool" );
+ if (pImp->mpMaster->pImp->mpSecondary == this)
+ pImp->mpMaster->pImp->mpSecondary = NULL;
+ }
+
delete pImp;
}