summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-port-switch.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-10-09 15:59:09 +0200
committerStefano Karapetsas <[email protected]>2014-10-09 15:59:09 +0200
commit526fdf477edc40452c18b51e13cbdffaa69de52b (patch)
treedd73763b097fca2a86288bcb55881a96f3e5faaf /backends/pulse/pulse-port-switch.c
parentb4695e82ae0cc3183e9d3be4fca191394292609f (diff)
parent0ab66491e3847f6de92fc5358e9687c6d2f458ce (diff)
downloadlibmatemixer-526fdf477edc40452c18b51e13cbdffaa69de52b.tar.bz2
libmatemixer-526fdf477edc40452c18b51e13cbdffaa69de52b.tar.xz
Merge branch 'after-gsoc'
Diffstat (limited to 'backends/pulse/pulse-port-switch.c')
-rw-r--r--backends/pulse/pulse-port-switch.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/backends/pulse/pulse-port-switch.c b/backends/pulse/pulse-port-switch.c
index 08f1543..db06a7c 100644
--- a/backends/pulse/pulse-port-switch.c
+++ b/backends/pulse/pulse-port-switch.c
@@ -53,7 +53,6 @@ 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)
@@ -74,7 +73,6 @@ 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;
@@ -129,7 +127,11 @@ pulse_port_switch_set_property (GObject *object,
switch (param_id) {
case PROP_STREAM:
/* Construct-only object */
- swtch->priv->stream = g_value_dup_object (value);
+ swtch->priv->stream = g_value_get_object (value);
+
+ if (swtch->priv->stream != NULL)
+ g_object_add_weak_pointer (G_OBJECT (swtch->priv->stream),
+ (gpointer *) &swtch->priv->stream);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -145,18 +147,6 @@ pulse_port_switch_init (PulsePortSwitch *swtch)
PulsePortSwitchPrivate);
}
-static void
-pulse_port_switch_dispose (GObject *object)
-{
- PulsePortSwitch *swtch;
-
- swtch = PULSE_PORT_SWITCH (object);
-
- g_clear_object (&swtch->priv->stream);
-
- G_OBJECT_CLASS (pulse_port_switch_parent_class)->dispose (object);
-}
-
PulseStream *
pulse_port_switch_get_stream (PulsePortSwitch *swtch)
{