summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-port-switch.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-10-23 22:02:39 +0200
committerMichal Ratajsky <[email protected]>2014-10-23 22:02:39 +0200
commit09c9b73913574a6862135bbcb9d7c2da1f3eea23 (patch)
treefe92da0a6e69d4b5341063a752ccbc01e40ceab1 /backends/pulse/pulse-port-switch.c
parentb9e004261b979b885e7348484e302176b30d5b54 (diff)
downloadlibmatemixer-09c9b73913574a6862135bbcb9d7c2da1f3eea23.tar.bz2
libmatemixer-09c9b73913574a6862135bbcb9d7c2da1f3eea23.tar.xz
Fix memory management problems
Diffstat (limited to 'backends/pulse/pulse-port-switch.c')
-rw-r--r--backends/pulse/pulse-port-switch.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/backends/pulse/pulse-port-switch.c b/backends/pulse/pulse-port-switch.c
index db06a7c..71e0709 100644
--- a/backends/pulse/pulse-port-switch.c
+++ b/backends/pulse/pulse-port-switch.c
@@ -53,6 +53,7 @@ static void pulse_port_switch_set_property (GObject *object,
GParamSpec *pspec);
static void pulse_port_switch_init (PulsePortSwitch *swtch);
+static void pulse_port_switch_dispose (GObject *object);
G_DEFINE_ABSTRACT_TYPE (PulsePortSwitch, pulse_port_switch, MATE_MIXER_TYPE_SWITCH)
@@ -73,6 +74,7 @@ pulse_port_switch_class_init (PulsePortSwitchClass *klass)
MateMixerSwitchClass *switch_class;
object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = pulse_port_switch_dispose;
object_class->get_property = pulse_port_switch_get_property;
object_class->set_property = pulse_port_switch_set_property;
@@ -147,6 +149,20 @@ pulse_port_switch_init (PulsePortSwitch *swtch)
PulsePortSwitchPrivate);
}
+static void
+pulse_port_switch_dispose (GObject *object)
+{
+ PulsePortSwitch *swtch;
+
+ swtch = PULSE_PORT_SWITCH (object);
+
+ if (swtch->priv->ports != NULL) {
+ g_list_free_full (swtch->priv->ports, g_object_unref);
+ swtch->priv->ports = NULL;
+ }
+ G_OBJECT_CLASS (pulse_port_switch_parent_class)->dispose (object);
+}
+
PulseStream *
pulse_port_switch_get_stream (PulsePortSwitch *swtch)
{