incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1352830 - /incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx
Date Fri, 22 Jun 2012 10:12:16 GMT
Author: alg
Date: Fri Jun 22 10:12:16 2012
New Revision: 1352830

URL: http://svn.apache.org/viewvc?rev=1352830&view=rev
Log:
#119991# changed order of freeing pools as needed

Modified:
    incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx

Modified: incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx?rev=1352830&r1=1352829&r2=1352830&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx Fri Jun 22 10:12:16 2012
@@ -66,13 +66,18 @@ SvxUnoDrawPool::SvxUnoDrawPool( SdrModel
 
 SvxUnoDrawPool::~SvxUnoDrawPool() throw()
 {
-    // memory leak #119991: to release the secondary pool created in function SvxUnoDrawPool::init()
-    SfxItemPool* pSecondaryPool=mpDefaultsPool->GetSecondaryPool();
-    if (pSecondaryPool != NULL)
-        SfxItemPool::Free(pSecondaryPool);
-    // memory leak #119991
+    // memory leak #119991#: to release the secondary pool created in function SvxUnoDrawPool::init()
+    SfxItemPool* pSecondaryPool = mpDefaultsPool->GetSecondaryPool();
 
+    // #119991# delete master pool first, this will reset the pMaster entry in pSecondaryPool
as needed.
+    // This is the needed order (see SdrModel::~SdrModel for example)
     SfxItemPool::Free(mpDefaultsPool);
+
+    // delete pSecondaryPool if exists
+    if(pSecondaryPool)
+    {
+        SfxItemPool::Free(pSecondaryPool);
+    }
 }
 
 void SvxUnoDrawPool::init()



Mime
View raw message