summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-11 16:52:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-11 17:10:05 +0100
commit7c3abee29c742593206b755b20a718c46f0780fa (patch)
treea26fc3a110994e1550dc4ef7ab2fde3d48355e9a /formula
parent19053e62d1f8e23c82d03c14228e127792ef46ce (diff)
Resolves: tdf#89643 report builder function wizard segfaults
regression from commit 3d6521280929ecacc53b7c358d29d0b5d31b3462 CommitDate: Thu Jul 31 22:14:25 2014 +0200 fix memory leak around function descriptions Found by Lsan. There are two implementations of getCategory, one (sc) returns a new one each time (hence the leak fix) and the other (reportdesign) returns a pointer to one that belongs to the manger (hence the crash). The code in formula really looks to me to expect that the getCategory return a pointer that "someone else" needs to look after, i.e. the reportdesign variant is the more correct so revert 3d6521280929ecacc53b7c358d29d0b5d31b3462 and to fix the leak make the sc own the ScFunctionCategories and just cache them like the reportdesign one does Change-Id: Ifd986301a54b4d20449e864697655cd973e0c4df
Diffstat (limited to 'formula')
-rw-r--r--formula/source/ui/dlg/FormulaHelper.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index dc15145b40a1..7570ef6373bc 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -23,8 +23,6 @@
#include <unotools/charclass.hxx>
#include <unotools/syslocale.hxx>
-#include <boost/scoped_ptr.hpp>
-
namespace formula
{
@@ -95,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)
{
- boost::scoped_ptr<const IFunctionCategory> pCategory(m_pFunctionManager->getCategory(j));
+ const IFunctionCategory* pCategory = m_pFunctionManager->getCategory(j);
const sal_uInt32 nCount = pCategory->getCount();
for(sal_uInt32 i = 0 ; i < nCount; ++i)
{