summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-09-14 22:19:52 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-09-15 05:09:57 +0200
commite89700f02c7aa521c9e52468f076b64f1b30fcac (patch)
tree11a57a5e68b75e156b7bf3dfb4ebb8eedb190c1a
parent031217619cf98fa527ba383938ac49f600d5c5d2 (diff)
tdf#112392: avoid leak in SvxEditModulesDlg (cui)
by using unique_ptr Change-Id: I07d71a6aa1fe1eef40280588e842b1a884eb499e Reviewed-on: https://gerrit.libreoffice.org/42307 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--cui/source/inc/optlingu.hxx2
-rw-r--r--cui/source/options/optlingu.cxx6
2 files changed, 3 insertions, 5 deletions
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 608091108aa6..ed742f5af32c 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -127,7 +127,7 @@ private:
css::uno::Reference<
css::linguistic2::XDictionary > > aDics;
- SvLBoxButtonData* pCheckButtonData;
+ std::unique_ptr<SvLBoxButtonData> pCheckButtonData;
SvxLinguData_Impl* pLinguData;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index c0c96f5c5ca6..213bb29b69da 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1011,8 +1011,6 @@ SvxLinguTabPage::SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rSet )
m_pLinguDicsCLB->set_height_request(m_pLinguDicsCLB->GetTextHeight() * 5);
m_pLinguOptionsCLB->set_height_request(m_pLinguOptionsCLB->GetTextHeight() * 5);
- pCheckButtonData = nullptr;
-
m_pLinguModulesCLB->SetStyle( m_pLinguModulesCLB->GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL );
m_pLinguModulesCLB->SetForceMakeVisible(true);
m_pLinguModulesCLB->SetHighlightRange();
@@ -1718,10 +1716,10 @@ SvTreeListEntry* SvxLinguTabPage::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
SvTreeListEntry* pEntry = new SvTreeListEntry;
if( !pCheckButtonData )
- pCheckButtonData = new SvLBoxButtonData(m_pLinguOptionsCLB);
+ pCheckButtonData.reset(new SvLBoxButtonData(m_pLinguOptionsCLB));
if (CBCOL_FIRST == nCol)
- pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData));
+ pEntry->AddItem(o3tl::make_unique<SvLBoxButton>(SvLBoxButtonKind::EnabledCheckbox, pCheckButtonData.get()));
if (CBCOL_SECOND == nCol)
pEntry->AddItem(o3tl::make_unique<SvLBoxString>("")); // empty column
pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>(Image(), Image(), false));