[Libreoffice-commits] core.git: svl/source

Andre Fischer af at apache.org
Fri Mar 15 12:26:29 PDT 2013


 svl/source/items/itempool.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 55dd17942cde0a1dd50fb534cff415adbc0b6a5e
Author: Andre Fischer <af at apache.org>
Date:   Thu Jun 21 07:27:44 2012 +0000

    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

diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 13b3b2a..54593b3 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -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;
 }
 


More information about the Libreoffice-commits mailing list