[SCM] KDE Multimedia module packaging branch, master, updated. debian/4.6.5-1-2-g39892ba

José Manuel Santamaría Lema santa-guest at alioth.debian.org
Tue Jul 19 12:19:22 UTC 2011


The following commit has been merged in the master branch:
commit 39892ba466a932858d2cc6bd8fe37916fabff111
Author: José Manuel Santamaría Lema <panfaust at gmail.com>
Date:   Tue Jul 19 13:49:46 2011 +0200

    Add kmix_memleak_pulse.diff.
---
 debian/changelog                       |    2 +
 debian/patches/kmix_memleak_pulse.diff |   86 ++++++++++++++++++++++++++++++++
 debian/patches/series                  |    1 +
 3 files changed, 89 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ee7f97b..0d367de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,7 @@
 kdemultimedia (4:4.6.5-2) UNRELEASED; urgency=low
 
+  [ José Manuel Santamaría Lema ]
+  * Add kmix_memleak_pulse.diff.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Tue, 19 Jul 2011 13:46:44 +0200
 
diff --git a/debian/patches/kmix_memleak_pulse.diff b/debian/patches/kmix_memleak_pulse.diff
new file mode 100644
index 0000000..a4b3bc5
--- /dev/null
+++ b/debian/patches/kmix_memleak_pulse.diff
@@ -0,0 +1,86 @@
+Author: Harald Sitter <sitter at kde.org>
+Origin: http://websvn.kde.org/?view=revision&revision=1241346
+Description: Fix a memory leak with kmix pulse backend.
+ This is the text of the commit 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 at kde.org
+ CCMAIL: kde-packager at kde.org
+ CCMAIL: cguthrie at mandriva.org
+ BUG: 264089
+ CCBUG: 237239
+
+--- a/kmix/backends/mixer_pulse.cpp
++++ b/kmix/backends/mixer_pulse.cpp
+@@ -754,7 +754,12 @@ void Mixer_PULSE::addWidget(int index)
+         return;
+     }
+     addDevice((*map)[index]);
+-    emit controlsReconfigured(_mixer->id());
++    // Do not emit directly to ensure all connected slots are executed
++    // in their own event loop.
++    QMetaObject::invokeMethod(this,
++                              "controlsReconfigured",
++                              Qt::QueuedConnection,
++                              Q_ARG(QString, _mixer->id()));
+ }
+ 
+ void Mixer_PULSE::removeWidget(int index)
+@@ -778,7 +783,12 @@ void Mixer_PULSE::removeWidget(int index
+         {
+             delete *iter;
+             m_mixDevices.erase(iter);
+-            emit controlsReconfigured(_mixer->id());
++            // Do not emit directly to ensure all connected slots are executed
++            // in their own event loop.
++            QMetaObject::invokeMethod(this,
++                                      "controlsReconfigured",
++                                      Qt::QueuedConnection,
++                                      Q_ARG(QString, _mixer->id()));
+             return;
+         }
+     }
+@@ -799,7 +809,12 @@ void Mixer_PULSE::removeAllWidgets()
+         delete *iter;
+         m_mixDevices.erase(iter);
+     }
+-    emit controlsReconfigured(_mixer->id());
++    // Do not emit directly to ensure all connected slots are executed
++    // in their own event loop.
++    QMetaObject::invokeMethod(this,
++                              "controlsReconfigured",
++                              Qt::QueuedConnection,
++                              Q_ARG(QString, _mixer->id()));
+ }
+ 
+ void Mixer_PULSE::addDevice(devinfo& dev)
+@@ -990,7 +1005,7 @@ int Mixer_PULSE::open()
+         kDebug(67100) <<  "Using PulseAudio for mixer: " << m_mixerName;
+         m_isOpen = true;
+     }
+- 
++
+     return 0;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 9aa57e8..58ab0e5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 kmix_showeverywhere.diff
 fix_target_link_libraries.diff
+kmix_memleak_pulse.diff

-- 
KDE Multimedia module packaging



More information about the pkg-kde-commits mailing list