summaryrefslogtreecommitdiff
path: root/libmatemixer/matemixer-stream-switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmatemixer/matemixer-stream-switch.c')
-rw-r--r--libmatemixer/matemixer-stream-switch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmatemixer/matemixer-stream-switch.c b/libmatemixer/matemixer-stream-switch.c
index 814918d..cfb74c8 100644
--- a/libmatemixer/matemixer-stream-switch.c
+++ b/libmatemixer/matemixer-stream-switch.c
@@ -55,6 +55,8 @@ static void mate_mixer_stream_switch_set_property (GObject *o
const GValue *value,
GParamSpec *pspec);
+static void mate_mixer_stream_switch_dispose (GObject *object);
+
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MateMixerStreamSwitch, mate_mixer_stream_switch, MATE_MIXER_TYPE_SWITCH)
static void
@@ -63,6 +65,7 @@ mate_mixer_stream_switch_class_init (MateMixerStreamSwitchClass *klass)
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
+ object_class->dispose = mate_mixer_stream_switch_dispose;
object_class->get_property = mate_mixer_stream_switch_get_property;
object_class->set_property = mate_mixer_stream_switch_set_property;
@@ -161,6 +164,20 @@ mate_mixer_stream_switch_init (MateMixerStreamSwitch *swtch)
swtch->priv = mate_mixer_stream_switch_get_instance_private (swtch);
}
+static void
+mate_mixer_stream_switch_dispose (GObject *object)
+{
+ MateMixerStreamSwitch *swtch;
+
+ swtch = MATE_MIXER_STREAM_SWITCH (object);
+
+ if (swtch->priv->stream != NULL)
+ g_object_remove_weak_pointer(G_OBJECT (swtch->priv->stream),
+ (gpointer *) &swtch->priv->stream);
+
+ G_OBJECT_CLASS (mate_mixer_stream_switch_parent_class)->dispose (object);
+}
+
/**
* mate_mixer_stream_switch_get_flags:
* @swtch: a #MateMixerStreamSwitch