Description: TextEngine::SetAttrib(TextAttrib const&, unsigned int, int, int, bool) leaks memory with multiple invocations Steps to Reproduce: 1. Start the Instruments.app 2. Choose Memory Leak profile tool 3. Select LibreOffice.app in instdir as target process 4. Click on the record button, LODev is started by the profiling tool 5. Wait for the StartCenter to load. 6. Click on the new Writer document icon to open a blank Writer document. 7. Type some wrongly spelled text 8. Open the spelling dialog Tools -> Spelling 9. Correct or ignore suggestions 10. Close the spelling dialog 11. Stop recording (after the closing is fully processed) 12. Analyse the profile trace. Actual Results: TextEngine::SetAttrib(TextAttrib const&, unsigned int, int, int, bool) leaks memory with multiple invocations Expected Results: Shouldn't leak Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Created attachment 136542 [details] BT & Few screenshots
I'll give it a try.
(In reply to Julien Nabet from comment #2) > I'll give it a try. Is this one related: https://gerrit.libreoffice.org/#/c/42787/ ?
I confirm the leak but not so easy to tackle :-(
(In reply to Telesto from comment #3) > (In reply to Julien Nabet from comment #2) > > I'll give it a try. > Is this one related: https://gerrit.libreoffice.org/#/c/42787/ ? It may help but don't think so. I think we should even change: void SentenceEditWindow_Impl::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd ) to void SentenceEditWindow_Impl::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd ) to match with: void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate ) It supposes to change m_nErrorStart and m_nErrorEnd
Let's give a try by submitting to review this patch: https://gerrit.libreoffice.org/#/c/42881/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=19910c461230f70bb9e98ad44db3525f0d755724 tdf#112658: fix leak when calling TextEngine::SetAttrib 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.
It seems it's not a big leak according to the comments here: https://gerrit.libreoffice.org/#/c/42881/4 So let's put this one to FIXED.