You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/06/22 12:12:16 UTC

svn commit: r1352830 - /incubator/ooo/trunk/main/svx/source/unodraw/unopool.cxx

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()