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
This commit is contained in:
Andre Fischer 2012-06-21 07:27:44 +00:00 committed by Eike Rathke
parent 2ded844730
commit 55dd17942c

View file

@ -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;
}