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
Confirming with 5.4.1.1
PaletteManager::LoadPallettes() is also invoked by the Edit Style dialog, and although some of the memory is released when the dialog is closed, overall memory consumption continues to increase.
I submitted a patch to review here: https://gerrit.libreoffice.org/#/c/41710/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c82e5db9626e4d84300f84842b837e852be828be tdf#112027: avoid leaks in FillTreeBox (sfx2) It will be available in 6.0.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Alex: I'll wait for your feedback to see if it works and so to backport the patch on 5.4 branch.
Confirming fixed in Version: 6.0.0.0.alpha0+ Build ID: 595371e520ce4f64ad9d99a7866bdb8404271b6e CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; Locale: fr-FR (fr_FR.UTF-8); Calc: group Thanks Julien !
Here's the cherry-pick waiting for review in 5.4 branch: https://gerrit.libreoffice.org/#/c/41925/
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-5-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=02b95a0e8191fc560637b2fa3a62bca0bd51b9c4&h=libreoffice-5-4 tdf#112027: avoid leaks in FillTreeBox (sfx2) It will be available in 5.4.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.