incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1354940 - /incubator/ooo/trunk/main/sd/source/core/sdpage.cxx
Date Thu, 28 Jun 2012 11:26:32 GMT
Author: af
Date: Thu Jun 28 11:26:32 2012
New Revision: 1354940

URL: http://svn.apache.org/viewvc?rev=1354940&view=rev
Log:
#i120050# Fixed memory leak when SdrObject is removed from master page.

          Patch by: ChaoHuang
          Review and minor changes by: Andre Fischer

Modified:
    incubator/ooo/trunk/main/sd/source/core/sdpage.cxx

Modified: incubator/ooo/trunk/main/sd/source/core/sdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/core/sdpage.cxx?rev=1354940&r1=1354939&r2=1354940&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/core/sdpage.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/core/sdpage.cxx Thu Jun 28 11:26:32 2012
@@ -793,13 +793,19 @@ void SdPage::CreateTitleAndLayout(sal_Bo
 			// handout template
 
 			// delete all available handout presentation objects
-			SdrObject* pObj;
+			SdrObject *pObj=NULL;
 			while( (pObj = pMasterPage->GetPresObj(PRESOBJ_HANDOUT)) != 0 )
 			{
+				pMasterPage->RemoveObject(pObj->GetOrdNum());
+
 				if( bUndo )
+				{
 					pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
-
-				pMasterPage->RemoveObject(pObj->GetOrdNum());
+				}
+                else
+				{
+					SdrObject::Free( pObj );  // memory leak i120050
+				}
 			}
 
 			std::vector< Rectangle > aAreas;



Mime
View raw message