summaryrefslogtreecommitdiff
path: root/kde-unstable/kdemultimedia/fix-memleak-in-kmix.patch
blob: 31ea4a6062620c9471cb811261de334e73a562b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Index: kdemultimedia/kmix/backends/mixer_pulse.cpp
===================================================================
--- kdemultimedia/kmix/backends/mixer_pulse.cpp	(revision 1241345)
+++ kdemultimedia/kmix/backends/mixer_pulse.cpp	(revision 1241346)
@@ -754,7 +754,12 @@
         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 @@
         {
             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 @@
         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 @@
         kDebug(67100) <<  "Using PulseAudio for mixer: " << m_mixerName;
         m_isOpen = true;
     }
- 
+
     return 0;
 }