<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - SfxCommonTemplateDialog_Impl::FillTreeBox() leaks memory"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=112027">112027</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SfxCommonTemplateDialog_Impl::FillTreeBox() leaks memory
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0.0.0.alpha0+ Master
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Mac OS X (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>iplaw67@tuta.io
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
SfxCommonTemplateDialog_Impl::FillTreeBox() retains memory allocations
indefinitely instead of releasing causing memory consumption to increase. An
example of where this occurs in the UI is the Styles deck.

Steps to Reproduce:
1. Open Writer
2. Open the styles deck
3. Right click the style and click modify -> it's leaking at different places
4. Press Cancel and repeat step 3 (again leaking)

Actual Results:  
Memory leak through non-released memory

Expected Results:
Shouldn't leak


Reproducible: Always

User Profile Reset: No

Additional Info:
The problematic code as indicated by Instruments.app memory profiler appears to
lie in templdlg.cxx at lines 1028-1033 :

            StyleTree_Impl* pNew = new StyleTree_Impl(pStyle->GetName(),
pStyle->GetParent());
            aArr.push_back(pNew);
            pStyle = pStyleSheetPool->Next();
        }

        MakeTree_Impl(aArr);


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0)
Gecko/20100101 Firefox/54.0</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>