You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2012/06/21 10:27:45 UTC

svn commit: r1352449 - /incubator/ooo/trunk/main/svl/source/items/itempool.cxx

Author: af
Date: Thu Jun 21 08:27:44 2012
New Revision: 1352449

URL: http://svn.apache.org/viewvc?rev=1352449&view=rev
Log:
#i120041# Prevent fix caused by un-disposed secondary item pool.

Modified:
    incubator/ooo/trunk/main/svl/source/items/itempool.cxx

Modified: incubator/ooo/trunk/main/svl/source/items/itempool.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svl/source/items/itempool.cxx?rev=1352449&r1=1352448&r2=1352449&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svl/source/items/itempool.cxx (original)
+++ incubator/ooo/trunk/main/svl/source/items/itempool.cxx Thu Jun 21 08:27:44 2012
@@ -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)