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:
parent
2ded844730
commit
55dd17942c
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue