Revision 1241346


Jump to revision: Previous Next
Author: sitter
Date: Tue Jul 12 19:01:32 2011 UTC (12 years, 4 months ago)
Changed paths: 1
Log Message:
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


Changed paths:

Path Details
Directorytrunk/KDE/kdemultimedia/kmix/backends/mixer_pulse.cpp modified , text changed