diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-09 12:34:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-09 12:34:12 +0100 |
commit | 40df5fc0e30c0aa32157c645db8b5256dc8afcc3 (patch) | |
tree | a3cc0de92d07845752f67575ad984f5f7b047cca /sw | |
parent | 95e394a62e0fe0c780850367c83d0b54e89239d1 (diff) |
mem leaks in writer font options tabpage
Change-Id: I7378f1a230fc55a97bc06d154939502f6ddcc792
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index c1782d49bf8b..4aef2e132988 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -578,8 +578,11 @@ SwStdFontTabPage::SwStdFontTabPage( Window* pParent, SwStdFontTabPage::~SwStdFontTabPage() { - if(bDeletePrinter) + delete pFontList; + if (bDeletePrinter) + { delete pPrt; + } } SfxTabPage* SwStdFontTabPage::Create( Window* pParent, @@ -760,6 +763,11 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) const SfxPoolItem* pItem; + if (bDeletePrinter) + { + delete pPrt; + } + if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_PRINTER, sal_False, &pItem)) { pPrt = (SfxPrinter*)((const SwPtrItem*)pItem)->GetValue(); @@ -771,8 +779,8 @@ void SwStdFontTabPage::Reset( const SfxItemSet& rSet) SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, 0 ); pPrt = new SfxPrinter(pPrinterSet); - bDeletePrinter = sal_True; } + delete pFontList; pFontList = new FontList( pPrt ); // #i94536# prevent duplication of font entries when 'reset' button is pressed if( !pStandardBox->GetEntryCount() ) |