[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 237239] Kmix memory leak
From:       Harald Sitter <sitter () kde ! org>
Date:       2011-07-12 19:01:36
Message-ID: E1QgiDA-0001eX-2j () bugs ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=237239





--- Comment #46 from Harald Sitter <sitter kde org>  2011-07-12 19:01:34 ---
SVN commit 1241346 by sitter:

Do not emit signals directly but queue invokeMethod them to resolve
a memleak in KMix/Oxygen caused by PA callbacks.

Oxygen internally uses deleteLater to remove fancy animations from widgets.
Every time PA changes its sinks (for example on track change in a Phonon
player),
KMix recreates its sliders thus causing animation creation inside the oxygen
style.
On deletion of old sliders the oxygen additions should get deleted.
However since the switching originates in a direct call
chain from PA (via callback -> mixer impl -> emit -> kmix UI internals ->
oxygen) the
deleteLater does not actually do anything and never gets executed thus leaking
memory
big time (12 hours of music -> >100MB of leaked memory).
To resolve this issue the PA mixer now does not directly emit signals anymore
(which
translates to a direct function call) but instead uses the mixer's QMetaObject
to
deploy a *queued* invokeMethod call to the signal (therefore forcing queued
emission
and execution in the QEventLoop/QThread of the target, which in our case is the
main application thread rather than the calling back PA thread).
This has the advantage that even additional connections to the mixer singals
will always get a queued emission neverminding what the type of the actual
connection is.

Also this now should resolve the only remaining memleak with PA.

CCMAIL: kde-multimedia@kde.org
CCMAIL: kde-packager@kde.org
CCMAIL: cguthrie@mandriva.org
BUG: 264089
CCBUG: 237239


 M  +18 -3     mixer_pulse.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1241346

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic