summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-10 21:06:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 09:13:21 +0200
commit08ae774fe92f0576691c9b0177fef45d18fd77b3 (patch)
tree289af5cbad022701e0d52eeb38149e9a5020fe1b
parentf44e218ac77e1a6125e645a44c801808df99c7f0 (diff)
tdf#111567: fix memleak in TemplateLocalView::insertItems
Clearing mItemList at the begin of insertItems is a bad idea because it prevents ImplDeleteItems (called by updateItems, itself called at the end of insertItems) from clearing correctly mItemList See comments from bugtracker for more info (Thank you Alex for the precious info attached with memleak reports! :-)) Change-Id: I04976dbb065d1369562649fc97c33f7fd599b107 Reviewed-on: https://gerrit.libreoffice.org/40995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 05a338159761e012c2c8779f8927b0d709b4416f) Reviewed-on: https://gerrit.libreoffice.org/41002 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sfx2/source/control/templatelocalview.cxx2
1 files changed, 0 insertions, 2 deletions
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 6c5881422b15..2168cdd9ac59 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -777,8 +777,6 @@ bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, const OUString& sNe
void TemplateLocalView::insertItems(const std::vector<TemplateItemProperties> &rTemplates, bool isRegionSelected, bool bShowCategoryInTooltip)
{
- mItemList.clear();
-
std::vector<ThumbnailViewItem*> aItems(rTemplates.size());
for (size_t i = 0, n = rTemplates.size(); i < n; ++i )
{