About tdf#90566: Theme::disposing(void) memory leak: maChangeListeners is not properly disposed

julien2412 serval2412 at yahoo.fr
Mon Apr 13 02:36:08 PDT 2015


sberg wrote
> On 04/12/2015 08:50 AM, julien2412 wrote:
>> ...
> The general reason for this construct is multi-threading:  Access to the 
> maChangeListeners member typically needs to be guarded by some mutex 
> (typically a member of the same class instance as maChangeListeners), 
> and the calls "out of that instance" to the
> 
>    (*iListener)->disposing(aEvent);
> 
> must be done with that mutex not locked (to avoid deadlock).
> ...
> However, in this particular case, the access to maChangeListeners is not 
> guarded, but likely out of ignorance of the original author.

Thank you Stephan for your feedback.

I've tried to find a similar case with a mutex but haven't found any.
For example, in a completely different part,
http://opengrok.libreoffice.org/xref/core/sdext/source/presenter/PresenterWindowManager.cxx#943
no mutex.
Could you give an example so I could apply it to our initial case or do you
prefer I just fix the variable use for the moment?

Julien



--
View this message in context: http://nabble.documentfoundation.org/About-tdf-90566-Theme-disposing-void-memory-leak-maChangeListeners-is-not-properly-disposed-tp4146014p4146110.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list