<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Template Manager memory leak in TemplateLocalView::insertItems()"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=111567#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Template Manager memory leak in TemplateLocalView::insertItems()"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=111567">bug 111567</a>
              from <span class="vcard"><a class="email" href="mailto:serval2412@yahoo.fr" title="Julien Nabet <serval2412@yahoo.fr>"> <span class="fn">Julien Nabet</span></a>
</span></b>
        <pre>(In reply to Noel Grandin from <a href="show_bug.cgi?id=111567#c5">comment #5</a>)
<span class="quote">> To me, looks like the bug is that 

>    TemplateLocalView::insertItems()

> calls 

>    mItemList.clear();

> at the top of it's code. It should not, it should leave the clearing and
> deleting to 

>   ThumbnailView::updateItems

> which already handles it correctly.

> ...</span >

You're right Noel.
ThumbnailView::updateItems (from
<a href="https://opengrok.libreoffice.org/xref/core/sfx2/source/control/thumbnailview.cxx#1005">https://opengrok.libreoffice.org/xref/core/sfx2/source/control/thumbnailview.cxx#1005</a>)
calls ThumbnailView::ImplDeleteItems() (from
<a href="https://opengrok.libreoffice.org/xref/core/sfx2/source/control/thumbnailview.cxx#ImplDeleteItems">https://opengrok.libreoffice.org/xref/core/sfx2/source/control/thumbnailview.cxx#ImplDeleteItems</a>)
which deletes each item before clearing the vector.
So the simple patch would be to delete this extra "mItemList.clear();" in
TemplateLocalView::insertItems</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>