Bug 90566 - Theme::disposing(void) memory leak: maChangeListeners is not properly disposed
Summary: Theme::disposing(void) memory leak: maChangeListeners is not properly disposed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.0.0
Keywords:
Depends on:
Blocks: 90564
  Show dependency treegraph
 
Reported: 2015-04-11 13:32 UTC by Mike Kaganski
Modified: 2015-04-14 01:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2015-04-11 13:32:28 UTC
As noted at http://habrahabr.ru/company/pvs-studio/blog/251817/#comment_8312345:

http://cgit.freedesktop.org/libreoffice/core/tree/sfx2/source/sidebar/Theme.cxx#n393

The contents of maChangeListeners is swapped with a new empty container aListeners. Then, the [now empty] maChangeListeners is traversed to dispose its contents. Thus, here must be an error and memory leak.

aListeners should be traversed instead.
Comment 1 Julien Nabet 2015-04-12 06:51:21 UTC
Agree with you, I thought also about simplifying this, see http://nabble.documentfoundation.org/About-tdf-90566-Theme-disposing-void-memory-leak-maChangeListeners-is-not-properly-disposed-td4146014.html
But perhaps I missed something obvious.
Comment 2 Julien Nabet 2015-04-13 21:58:03 UTC
Fixed on master with http://cgit.freedesktop.org/libreoffice/core/commit/?id=cbbb24d0afcdbdac21d03ec4ee1455a3834afff4

For 4.4 branch, there's a patch on gerrit waiting for review: https://gerrit.libreoffice.org/#/c/15290/