summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-11 16:52:09 +0100
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:22:28 +0200
commitd0d07b079a31fb4412a57cb45a3d3e74658af27b (patch)
tree701ca8c3958dad92ac55d89af101db559a532405 /formula
parenta4b90bd12bdc0b133601c7e49d348ea0eec89bcb (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 (cherry picked from commit 7c3abee29c742593206b755b20a718c46f0780fa)
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)
{