diff options
author | Andre Fischer <af@apache.org> | 2012-06-28 10:26:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-02 11:14:35 +0100 |
commit | 3af051aa4a554c33e146a2329d8d504cf8908022 (patch) | |
tree | b00a537c59815e8a57fee953c8f593105c844d1b /sd | |
parent | de7b2781bdb03858379fe6e792ea32f62a8208ec (diff) |
Resolves: #i120050# memory leak when SdrObject is removed from master page
Patch by: ChaoHuang
Review and minor changes by: Andre Fischer
(cherry picked from commit aee07d48ed6a24ffd4b4dac73236fb3a3ec5e800)
Change-Id: If3735c82dc2d02965fa0403c3adf549e4e6e8c26
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/sdpage.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index b9bf6dab25a8..8261bf8a3be0 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -774,13 +774,19 @@ void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate ) // 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; |