summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-10 21:06:43 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-08-11 07:37:22 +0200
commit05a338159761e012c2c8779f8927b0d709b4416f (patch)
treef177ceb9efd9c13df91ffa4b34319cf3e6f3b7a4
parent4e2b44860c2c304ea728c512b47ca07aaf1cd452 (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 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
-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 81a6ef3bbe75..808e0b1a9a75 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -772,8 +772,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 )
{