incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1352449 - /incubator/ooo/trunk/main/svl/source/items/itempool.cxx
Date Thu, 21 Jun 2012 08:27:45 GMT
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)



Mime
View raw message