Revision 1241346
Go back to digest for 17th July 2011Bug Fixes in Multimedia
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.
File Changes
- /trunk/KDE/kdemultimedia/kmix/backends/mixer_pulse.cpp