formula/source/ui/dlg/FormulaHelper.cxx | 4 +++- include/formula/IFunctionDescription.hxx | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-)
New commits: commit 9f149784501b6c867f6136d94d438ad926964efd Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Thu Jul 31 21:43:59 2014 +0200 fix memory leak around function descriptions Found by Lsan. Change-Id: Ia443ed6eb2a20854998a615f3c2bd9fdac156a8c (cherry picked from commit 3d6521280929ecacc53b7c358d29d0b5d31b3462) Reviewed-on: https://gerrit.libreoffice.org/10740 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 5805778..6c999bd 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -21,6 +21,8 @@ #include <unotools/charclass.hxx> #include <unotools/syslocale.hxx> +#include <boost/scoped_ptr.hpp> + namespace formula { @@ -91,7 +93,7 @@ bool FormulaHelper::GetNextFunc( const OUString& rFormula, const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount(); for(sal_uInt32 j= 0; j < nCategoryCount && !*ppFDesc; ++j) { - const IFunctionCategory* pCategory = m_pFunctionManager->getCategory(j); + boost::scoped_ptr<const IFunctionCategory> pCategory(m_pFunctionManager->getCategory(j)); const sal_uInt32 nCount = pCategory->getCount(); for(sal_uInt32 i = 0 ; i < nCount; ++i) { diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx index 7f75d64..aceac35 100644 --- a/include/formula/IFunctionDescription.hxx +++ b/include/formula/IFunctionDescription.hxx @@ -60,7 +60,7 @@ namespace formula ~IFunctionManager() {} }; - class SAL_NO_VTABLE IFunctionCategory + class IFunctionCategory { public: IFunctionCategory(){} @@ -70,8 +70,7 @@ namespace formula virtual sal_uInt32 getNumber() const = 0; virtual OUString getName() const = 0; - protected: - ~IFunctionCategory() {} + virtual ~IFunctionCategory() {} }; class SAL_NO_VTABLE IFunctionDescription
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits