[Libreoffice-commits] core.git: cui/source

Julien Nabet serval2412 at yahoo.fr
Sat Sep 30 09:33:13 UTC 2017


 cui/source/inc/optlingu.hxx     |    2 +-
 cui/source/options/optlingu.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d784dc4fd4e7b8b1f7468dd3fe1c952f8ab7037f
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 30 10:01:15 2017 +0200

    Related tdf#112393: avoid leak in SvxEditModulesDlg::CreateEntry
    
    by using unique_ptr
    bt:
    0  0x00007fffee95a933 in SvLBoxButtonData::SvLBoxButtonData(Control const*) (this=0x55555c1c28d0, pControlForSettings=0x55555c1b9680)
        at /home/julien/lo/libreoffice/svtools/source/contnr/svlbitm.cxx:55
    1  0x00007fff95cde826 in SvxEditModulesDlg::CreateEntry(rtl::OUString&, unsigned short) (this=0x55555c17f270, rTxt="Orthographe", nCol=1)
        at /home/julien/lo/libreoffice/cui/source/options/optlingu.cxx:1842
    2  0x00007fff95cdf4dd in SvxEditModulesDlg::LangSelectHdl_Impl(ListBox const*) (this=0x55555c17f270, pBox=0x55555c19dc60)
        at /home/julien/lo/libreoffice/cui/source/options/optlingu.cxx:2004
    
    Change-Id: I6f10d7adae4346b204e21bdaca16aacb2758003d
    Reviewed-on: https://gerrit.libreoffice.org/42962
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index ed742f5af32c..66017664c93b 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -70,7 +70,7 @@ class SvxEditModulesDlg : public ModalDialog
     SvxLinguData_Impl*  pDefaultLinguData;
     SvxLinguData_Impl&  rLinguData;
 
-    SvLBoxButtonData*   pCheckButtonData;
+    std::unique_ptr<SvLBoxButtonData>   pCheckButtonData;
 
     SvTreeListEntry*    CreateEntry(OUString& rTxt, sal_uInt16 nCol);
 
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index bc0690d3c26d..efde456a95b6 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1839,12 +1839,12 @@ SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol
     SvTreeListEntry* pEntry = new SvTreeListEntry;
     if( !pCheckButtonData )
     {
-        pCheckButtonData = new SvLBoxButtonData(m_pModulesCLB);
+        pCheckButtonData.reset(new SvLBoxButtonData(m_pModulesCLB));
         pCheckButtonData->SetLink( LINK( this, SvxEditModulesDlg, BoxCheckButtonHdl_Impl2 ) );
     }
 
     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));


More information about the Libreoffice-commits mailing list