[Libreoffice-commits] core.git: 6 commits - leak-suppress.txt sc/qa sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Mar 12 16:23:04 UTC 2016
leak-suppress.txt | 4 ++++
sc/qa/unit/bugfix-test.cxx | 2 +-
sc/qa/unit/copy_paste_test.cxx | 2 +-
sc/source/core/data/dptabres.cxx | 3 ++-
sc/source/filter/excel/xecontent.cxx | 8 +++++---
sc/source/filter/inc/XclExpChangeTrack.hxx | 4 ++--
sc/source/filter/xcl97/XclExpChangeTrack.cxx | 11 +++++------
7 files changed, 20 insertions(+), 14 deletions(-)
New commits:
commit 602f4c8a6133d337853edf47750044a77ef6247d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 17:08:09 2016 +0100
fix memory leak in copy_paste test
Change-Id: If16f6c0cb4d2bd2ae820b62fc7d563df09b27bbb
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index 44a24d6..575fbae 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -118,7 +118,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
// 6. Paste
pViewShell->GetViewData().GetView()->PasteFromClip(InsertDeleteFlags::ALL, &aClipDoc);
- xDocSh->DoClose();
+ xComponent->dispose();
}
ScCopyPasteTest::ScCopyPasteTest()
commit 22ea08bdb5d64636cf76a58d6b34be01f5f50791
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 17:07:46 2016 +0100
fix memory leak in cond format export
Change-Id: I3c0379dfa972cb552382153f3d363eaf3bfe604d
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 71a3809..f8162b4 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -945,14 +945,16 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
{
rWorksheet->startElement( XML_formula, FSEND );
+ std::unique_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateTokenArry(0));
rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(),
- mrFormatEntry.CreateTokenArry(0)));
+ pTokenArray.get()));
rWorksheet->endElement( XML_formula );
if (bFmla2)
{
rWorksheet->startElement( XML_formula, FSEND );
+ std::unique_ptr<ScTokenArray> pTokenArray2(mrFormatEntry.CreateTokenArry(1));
rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetCompileFormulaContext(), mrFormatEntry.GetValidSrcPos(),
- mrFormatEntry.CreateTokenArry(1)));
+ pTokenArray2.get()));
rWorksheet->endElement( XML_formula );
}
}
@@ -1091,7 +1093,7 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm )
if(mrEntry.GetType() == COLORSCALE_FORMULA)
{
OUString aFormula = XclXmlUtils::ToOUString( GetCompileFormulaContext(), maSrcPos,
- mrEntry.GetFormula()->Clone());
+ mrEntry.GetFormula());
aValue = OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8 );
}
else
commit 867bf5b48eeae3925de2196d38554518938f9c1a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 16:49:29 2016 +0100
fix memory leak in change tracking export
Change-Id: Idffa7c4a9c9519c150458db3749e7b67fbbb463c
diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx
index 2818210..928d45f 100644
--- a/sc/source/filter/inc/XclExpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclExpChangeTrack.hxx
@@ -251,7 +251,7 @@ class XclExpXmlChTrHeader : public ExcXmlRecord
sal_uInt32 mnMaxAction;
std::vector<sal_uInt16> maTabBuffer;
- std::vector<XclExpChTrAction*> maActions;
+ std::vector<std::unique_ptr<XclExpChTrAction>> maActions;
public:
XclExpXmlChTrHeader(
@@ -260,7 +260,7 @@ public:
virtual void SaveXml( XclExpXmlStream& rStrm ) override;
- void AppendAction( XclExpChTrAction* pAction );
+ void AppendAction( std::unique_ptr<XclExpChTrAction> pAction );
};
// XclExpChTrInfo - header of action group of a user
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 9e9ccc2..2d2e675 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -476,11 +476,10 @@ void XclExpXmlChTrHeader::SaveXml( XclExpXmlStream& rStrm )
pRevLogStrm->write(">");
- std::vector<XclExpChTrAction*>::iterator it = maActions.begin(), itEnd = maActions.end();
+ auto it = maActions.begin(), itEnd = maActions.end();
for (; it != itEnd; ++it)
{
- XclExpChTrAction* p = *it;
- p->SaveXml(rStrm);
+ (*it)->SaveXml(rStrm);
}
pRevLogStrm->write("</")->writeId(XML_revisions)->write(">");
@@ -490,7 +489,7 @@ void XclExpXmlChTrHeader::SaveXml( XclExpXmlStream& rStrm )
pHeader->write("</")->writeId(XML_header)->write(">");
}
-void XclExpXmlChTrHeader::AppendAction( XclExpChTrAction* pAction )
+void XclExpXmlChTrHeader::AppendAction( std::unique_ptr<XclExpChTrAction> pAction )
{
sal_uInt32 nActionNum = pAction->GetActionNumber();
if (!mnMinAction || mnMinAction > nActionNum)
@@ -499,7 +498,7 @@ void XclExpXmlChTrHeader::AppendAction( XclExpChTrAction* pAction )
if (!mnMaxAction || mnMaxAction < nActionNum)
mnMaxAction = nActionNum;
- maActions.push_back(pAction);
+ maActions.push_back(std::move(pAction));
}
XclExpChTrInfo::XclExpChTrInfo( const OUString& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID ) :
@@ -1517,7 +1516,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
pHeaders->SetGUID(aGUID);
}
pAction->SetIndex(nIndex);
- pCurHeader->AppendAction(pAction);
+ pCurHeader->AppendAction(std::unique_ptr<XclExpChTrAction>(pAction));
}
pHeaders->SetGUID(aGUID);
commit a0ac896fea5613f38a7586e7ce991570437d654d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 15:54:27 2016 +0100
fix memory leak in bugfix_test
Change-Id: I944d2be4290cd381c3bee93ce12f67695bbb7ce8
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index fcf3796..f545953 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -207,7 +207,7 @@ void ScFiltersTest::testTdf91979()
CPPUNIT_ASSERT(aPos.getX() == (MAXCOL - 1) * nColWidth);
CPPUNIT_ASSERT(aPos.getY() == 10000 * nRowHeight);
- xDocSh->DoClose();
+ xComponent->dispose();
}
/*
commit 98abd6bbed4151df6b3318526863f842be3ac4a7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 15:21:55 2016 +0100
ignore a few low level libc leaks for now
Change-Id: I9899ee038a3ed323b77985f63fe189fc39ac1998
diff --git a/leak-suppress.txt b/leak-suppress.txt
index a951971..ce4b423 100644
--- a/leak-suppress.txt
+++ b/leak-suppress.txt
@@ -44,3 +44,7 @@ leak:libGL.so
# knowingly leaked in the unit tests to get a SfxMedium
leak:SfxObjectShell::DoInitUnitTest
+
+# ignore some libc related leaks
+leak:__new_exitfn
+leak:__GI___strdup
commit a9c3b23c3b68b7dfa84e0c96e3acb74b4ebb876a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Mar 12 15:11:11 2016 +0100
fix memory leak in pivot table code
Change-Id: I191e2748980b627b38e604ad456612535bda0302
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 9afed8a..d1eeccc 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -890,7 +890,8 @@ ResultMembers* ScDPResultData::GetDimResultMembers(long nDim, ScDPDimension* pDi
if (nDim < static_cast<long>(maDimMembers.size()) && maDimMembers[nDim])
return maDimMembers[nDim];
- maDimMembers.resize(nDim+1, nullptr);
+ if (nDim >= static_cast<long>(maDimMembers.size()))
+ maDimMembers.resize(nDim+1, nullptr);
ResultMembers* pResultMembers = new ResultMembers();
// global order is used to initialize aMembers, so it doesn't have to be looked at later
More information about the Libreoffice-commits
mailing list