diff options
author | Andre Fischer <af@apache.org> | 2012-06-21 07:27:44 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2012-06-21 07:27:44 +0000 |
commit | b2ab5a63f580ba516969c376100cef771f057bc3 (patch) | |
tree | 97a37a1d87fb01daf1c17a89bae85978d9297f74 /svl | |
parent | bcf01fd794ec169aaf2a3f8b86f986ec60e5beb8 (diff) |
#i120041# Prevent fix caused by un-disposed secondary item pool.
Notes
merged as: 55dd17942cde0a1dd50fb534cff415adbc0b6a5e
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itempool.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index c965000a93c1..cdd195076212 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -381,12 +381,22 @@ void SfxItemPool::ReleaseDefaults SfxItemPool::~SfxItemPool() { DBG_DTOR(SfxItemPool, 0); - DBG_ASSERT( pMaster == this, "destroying active Secondary-Pool" ); if ( pImp->ppPoolItems && ppPoolDefaults ) Delete(); delete[] _pPoolRanges; delete pImp; + + if (pMaster != NULL && pMaster != this) + { + // This condition indicates an error. A + // pMaster->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( pMaster == this, "destroying active Secondary-Pool" ); + if (pMaster->pSecondary == this) + pMaster->pSecondary = NULL; + } } void SfxItemPool::Free(SfxItemPool* pPool) |