From 9cbe39ab7c55bcad401de32716c5c8106f166291 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Sat, 9 Jan 2016 20:25:33 +0100 Subject: Provide and use convenience functions to remove some copy-pasted code --- backends/alsa/alsa-backend.c | 15 ++------- backends/alsa/alsa-device.c | 28 +++++------------ backends/alsa/alsa-stream.c | 11 ++----- backends/alsa/alsa-switch.c | 5 +-- backends/oss/oss-backend.c | 20 +++--------- backends/oss/oss-device.c | 3 +- backends/oss/oss-stream-control.c | 6 +--- backends/oss/oss-stream.c | 15 +++------ backends/oss/oss-switch.c | 11 ++----- backends/pulse/pulse-backend.c | 61 +++++++----------------------------- backends/pulse/pulse-device-switch.c | 6 ++-- backends/pulse/pulse-device.c | 24 +++----------- backends/pulse/pulse-port-switch.c | 6 ++-- backends/pulse/pulse-sink.c | 24 +++----------- backends/pulse/pulse-source.c | 24 +++----------- 15 files changed, 56 insertions(+), 203 deletions(-) (limited to 'backends') diff --git a/backends/alsa/alsa-backend.c b/backends/alsa/alsa-backend.c index 3d62380..fb045ec 100644 --- a/backends/alsa/alsa-backend.c +++ b/backends/alsa/alsa-backend.c @@ -219,12 +219,8 @@ alsa_backend_close (MateMixerBackend *backend) g_source_destroy (alsa->priv->timeout_source); - if (alsa->priv->devices != NULL) { - g_list_free_full (alsa->priv->devices, g_object_unref); - alsa->priv->devices = NULL; - } - - free_stream_list (alsa); + _mate_mixer_clear_object_list (&alsa->priv->devices); + _mate_mixer_clear_object_list (&alsa->priv->streams); g_clear_object (&alsa->priv->default_device); g_hash_table_remove_all (alsa->priv->devices_ids); @@ -605,12 +601,7 @@ set_default_device (AlsaBackend *alsa, AlsaDevice *device) static void free_stream_list (AlsaBackend *alsa) { - if (alsa->priv->streams == NULL) - return; - - g_list_free_full (alsa->priv->streams, g_object_unref); - - alsa->priv->streams = NULL; + _mate_mixer_clear_object_list (&alsa->priv->streams); } static gint diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c index 2064f79..c18d143 100644 --- a/backends/alsa/alsa-device.c +++ b/backends/alsa/alsa-device.c @@ -22,7 +22,9 @@ #include #include #include + #include +#include #include "alsa-compat.h" #include "alsa-constants.h" @@ -155,8 +157,6 @@ static void get_switch_info (snd_mixer_elem_t static void close_mixer (AlsaDevice *device); -static void free_stream_list (AlsaDevice *device); - static void alsa_device_class_init (AlsaDeviceClass *klass) { @@ -208,7 +208,7 @@ alsa_device_dispose (GObject *object) g_clear_object (&device->priv->input); g_clear_object (&device->priv->output); - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); G_OBJECT_CLASS (alsa_device_parent_class)->dispose (object); } @@ -339,7 +339,7 @@ alsa_device_close (AlsaDevice *device) /* Make each stream remove its controls and switches */ if (alsa_stream_has_controls_or_switches (device->priv->input) == TRUE) { alsa_stream_remove_all (device->priv->input); - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", @@ -348,7 +348,7 @@ alsa_device_close (AlsaDevice *device) if (alsa_stream_has_controls_or_switches (device->priv->output) == TRUE) { alsa_stream_remove_all (device->priv->output); - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", @@ -475,7 +475,7 @@ add_element (AlsaDevice *device, AlsaStream *stream, AlsaElement *element) } if (add_stream == TRUE) { - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); /* Pretend the stream has just been created now that we have added * the first control */ @@ -755,7 +755,7 @@ remove_elements_by_name (AlsaDevice *device, const gchar *name) if (alsa_stream_remove_elements (device->priv->input, name) == TRUE) { /* Removing last stream element "removes" the stream */ if (alsa_stream_has_controls_or_switches (device->priv->input) == FALSE) { - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", MATE_MIXER_STREAM (device->priv->input)); @@ -765,7 +765,7 @@ remove_elements_by_name (AlsaDevice *device, const gchar *name) if (alsa_stream_remove_elements (device->priv->output, name) == TRUE) { /* Removing last stream element "removes" the stream */ if (alsa_stream_has_controls_or_switches (device->priv->output) == FALSE) { - free_stream_list (device); + _mate_mixer_clear_object_list (&device->priv->streams); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", MATE_MIXER_STREAM (device->priv->output)); @@ -1122,15 +1122,3 @@ close_mixer (AlsaDevice *device) device->priv->handle = NULL; snd_mixer_close (handle); } - -static void -free_stream_list (AlsaDevice *device) -{ - /* This function is called each time the stream list changes */ - if (device->priv->streams == NULL) - return; - - g_list_free_full (device->priv->streams, g_object_unref); - - device->priv->streams = NULL; -} diff --git a/backends/alsa/alsa-stream.c b/backends/alsa/alsa-stream.c index 7e9c89f..9c642fb 100644 --- a/backends/alsa/alsa-stream.c +++ b/backends/alsa/alsa-stream.c @@ -17,6 +17,7 @@ #include #include + #include #include @@ -78,14 +79,8 @@ alsa_stream_dispose (GObject *object) stream = ALSA_STREAM (object); - if (stream->priv->controls != NULL) { - g_list_free_full (stream->priv->controls, g_object_unref); - stream->priv->controls = NULL; - } - if (stream->priv->switches != NULL) { - g_list_free_full (stream->priv->switches, g_object_unref); - stream->priv->switches = NULL; - } + _mate_mixer_clear_object_list (&stream->priv->controls); + _mate_mixer_clear_object_list (&stream->priv->switches); G_OBJECT_CLASS (alsa_stream_parent_class)->dispose (object); } diff --git a/backends/alsa/alsa-switch.c b/backends/alsa/alsa-switch.c index c2a95ca..7ea9e71 100644 --- a/backends/alsa/alsa-switch.c +++ b/backends/alsa/alsa-switch.c @@ -86,10 +86,7 @@ alsa_switch_dispose (GObject *object) swtch = ALSA_SWITCH (object); - if (swtch->priv->options != NULL) { - g_list_free_full (swtch->priv->options, g_object_unref); - swtch->priv->options = NULL; - } + _mate_mixer_clear_object_list (&swtch->priv->options); G_OBJECT_CLASS (alsa_switch_parent_class)->dispose (object); } diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c index 5795e7c..bf5af37 100644 --- a/backends/oss/oss-backend.c +++ b/backends/oss/oss-backend.c @@ -267,12 +267,8 @@ oss_backend_close (MateMixerBackend *backend) if (oss->priv->timeout_source_default != NULL) g_source_destroy (oss->priv->timeout_source_default); - if (oss->priv->devices != NULL) { - g_list_free_full (oss->priv->devices, g_object_unref); - oss->priv->devices = NULL; - } - - free_stream_list (oss); + _mate_mixer_clear_object_list (&oss->priv->devices); + _mate_mixer_clear_object_list (&oss->priv->streams); g_clear_object (&oss->priv->default_device); g_hash_table_remove_all (oss->priv->devices_paths); @@ -388,7 +384,7 @@ read_device (OssBackend *oss, const gchar *path) * device's polling facility should handle this by itself. */ if (g_hash_table_contains (oss->priv->devices_paths, path) == TRUE) { - close (fd); + g_close (fd, NULL); return TRUE; } @@ -398,8 +394,7 @@ read_device (OssBackend *oss, const gchar *path) device = oss_device_new (bname, label, path, fd); g_free (bname); g_free (label); - - close (fd); + g_close (fd, NULL); if G_LIKELY (device != NULL) { if (oss_device_open (device) == TRUE) { @@ -717,12 +712,7 @@ set_default_device_index (OssBackend *oss, guint index, gboolean fallback) static void free_stream_list (OssBackend *oss) { - if (oss->priv->streams == NULL) - return; - - g_list_free_full (oss->priv->streams, g_object_unref); - - oss->priv->streams = NULL; + _mate_mixer_clear_object_list (&oss->priv->streams); } static gint diff --git a/backends/oss/oss-device.c b/backends/oss/oss-device.c index 582c837..d11555d 100644 --- a/backends/oss/oss-device.c +++ b/backends/oss/oss-device.c @@ -368,8 +368,7 @@ oss_device_close (OssDevice *device) if (device->priv->poll_tag_restore != 0) g_source_remove (device->priv->poll_tag_restore); - close (device->priv->fd); - device->priv->fd = -1; + _mate_mixer_clear_fd (&device->priv->fd); g_signal_emit (G_OBJECT (device), signals[CLOSED], 0); } diff --git a/backends/oss/oss-stream-control.c b/backends/oss/oss-stream-control.c index bcb73fe..f826f62 100644 --- a/backends/oss/oss-stream-control.c +++ b/backends/oss/oss-stream-control.c @@ -206,11 +206,7 @@ oss_stream_control_close (OssStreamControl *control) { g_return_if_fail (OSS_IS_STREAM_CONTROL (control)); - if (control->priv->fd == -1) - return; - - close (control->priv->fd); - control->priv->fd = -1; + _mate_mixer_clear_fd (&control->priv->fd); } static guint diff --git a/backends/oss/oss-stream.c b/backends/oss/oss-stream.c index 7727dad..63c8481 100644 --- a/backends/oss/oss-stream.c +++ b/backends/oss/oss-stream.c @@ -18,6 +18,7 @@ #include #include #include + #include #include @@ -75,14 +76,8 @@ oss_stream_dispose (GObject *object) stream = OSS_STREAM (object); - if (stream->priv->controls != NULL) { - g_list_free_full (stream->priv->controls, g_object_unref); - stream->priv->controls = NULL; - } - if (stream->priv->switches != NULL) { - g_list_free_full (stream->priv->switches, g_object_unref); - stream->priv->switches = NULL; - } + _mate_mixer_clear_object_list (&stream->priv->controls); + _mate_mixer_clear_object_list (&stream->priv->switches); g_clear_object (&stream->priv->swtch); @@ -250,9 +245,7 @@ oss_stream_remove_all (OssStream *stream) if (stream->priv->swtch != NULL) { oss_switch_close (stream->priv->swtch); - - g_list_free_full (stream->priv->switches, g_object_unref); - stream->priv->switches = NULL; + _mate_mixer_clear_object_list (&stream->priv->switches); g_signal_emit_by_name (G_OBJECT (stream), "switch-removed", diff --git a/backends/oss/oss-switch.c b/backends/oss/oss-switch.c index 87ffb90..5ce3012 100644 --- a/backends/oss/oss-switch.c +++ b/backends/oss/oss-switch.c @@ -78,10 +78,7 @@ oss_switch_dispose (GObject *object) swtch = OSS_SWITCH (object); - if (swtch->priv->options != NULL) { - g_list_free_full (swtch->priv->options, g_object_unref); - swtch->priv->options = NULL; - } + _mate_mixer_clear_object_list (&swtch->priv->options); G_OBJECT_CLASS (oss_switch_parent_class)->dispose (object); } @@ -206,11 +203,7 @@ oss_switch_close (OssSwitch *swtch) { g_return_if_fail (OSS_IS_SWITCH (swtch)); - if (swtch->priv->fd == -1) - return; - - close (swtch->priv->fd); - swtch->priv->fd = -1; + _mate_mixer_clear_fd (&swtch->priv->fd); } static gboolean diff --git a/backends/pulse/pulse-backend.c b/backends/pulse/pulse-backend.c index 88926be..71f6fa0 100644 --- a/backends/pulse/pulse-backend.c +++ b/backends/pulse/pulse-backend.c @@ -205,10 +205,6 @@ static void remove_source_output (PulseBackend PulseSource *source, guint index); -static void free_list_devices (PulseBackend *pulse); -static void free_list_streams (PulseBackend *pulse); -static void free_list_ext_streams (PulseBackend *pulse); - static gboolean compare_stream_names (gpointer key, gpointer value, gpointer user_data); @@ -469,9 +465,9 @@ pulse_backend_close (MateMixerBackend *backend) g_clear_object (&pulse->priv->connection); } - free_list_devices (pulse); - free_list_streams (pulse); - free_list_ext_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->devices_list); + _mate_mixer_clear_object_list (&pulse->priv->streams_list); + _mate_mixer_clear_object_list (&pulse->priv->ext_streams_list); g_hash_table_remove_all (pulse->priv->devices); g_hash_table_remove_all (pulse->priv->sinks); @@ -776,7 +772,7 @@ on_connection_card_info (PulseConnection *connection, GUINT_TO_POINTER (info->index), device); - free_list_devices (pulse); + _mate_mixer_clear_object_list (&pulse->priv->devices_list); g_signal_emit_by_name (G_OBJECT (pulse), "device-added", MATE_MIXER_DEVICE (device)); @@ -798,7 +794,7 @@ on_connection_card_removed (PulseConnection *connection, g_object_ref (device); g_hash_table_remove (pulse->priv->devices, GUINT_TO_POINTER (index)); - free_list_devices (pulse); + _mate_mixer_clear_object_list (&pulse->priv->devices_list); g_signal_emit_by_name (G_OBJECT (pulse), "device-removed", MATE_MIXER_DEVICE (device)); @@ -826,7 +822,7 @@ on_connection_sink_info (PulseConnection *connection, GUINT_TO_POINTER (info->index), stream); - free_list_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->streams_list); if (device != NULL) { pulse_device_add_stream (device, stream); @@ -859,7 +855,7 @@ on_connection_sink_removed (PulseConnection *connection, g_object_ref (stream); g_hash_table_remove (pulse->priv->sinks, GUINT_TO_POINTER (idx)); - free_list_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->streams_list); device = pulse_stream_get_device (stream); if (device != NULL) { @@ -963,7 +959,7 @@ on_connection_source_info (PulseConnection *connection, GUINT_TO_POINTER (info->index), stream); - free_list_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->streams_list); if (device != NULL) { pulse_device_add_stream (device, stream); @@ -994,9 +990,9 @@ on_connection_source_removed (PulseConnection *connection, return; g_object_ref (stream); - g_hash_table_remove (pulse->priv->sources, GUINT_TO_POINTER (idx)); - free_list_streams (pulse); + + _mate_mixer_clear_object_list (&pulse->priv->streams_list); device = pulse_stream_get_device (stream); if (device != NULL) { @@ -1105,7 +1101,7 @@ on_connection_ext_stream_info (PulseConnection *connection, g_strdup (info->name), ext); - free_list_ext_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->ext_streams_list); g_signal_emit_by_name (G_OBJECT (pulse), "stored-control-added", @@ -1146,7 +1142,7 @@ on_connection_ext_stream_loaded (PulseConnection *connection, PulseBackend *puls g_object_ref (G_OBJECT (ext)); g_hash_table_iter_remove (&iter); - free_list_ext_streams (pulse); + _mate_mixer_clear_object_list (&pulse->priv->ext_streams_list); g_signal_emit_by_name (G_OBJECT (pulse), "stored-control-removed", MATE_MIXER_STORED_CONTROL (ext)); @@ -1228,39 +1224,6 @@ remove_source_output (PulseBackend *pulse, PulseSource *source, guint index) g_hash_table_remove (pulse->priv->source_output_map, GUINT_TO_POINTER (index)); } -static void -free_list_devices (PulseBackend *pulse) -{ - if (pulse->priv->devices_list == NULL) - return; - - g_list_free_full (pulse->priv->devices_list, g_object_unref); - - pulse->priv->devices_list = NULL; -} - -static void -free_list_streams (PulseBackend *pulse) -{ - if (pulse->priv->streams_list == NULL) - return; - - g_list_free_full (pulse->priv->streams_list, g_object_unref); - - pulse->priv->streams_list = NULL; -} - -static void -free_list_ext_streams (PulseBackend *pulse) -{ - if (pulse->priv->ext_streams_list == NULL) - return; - - g_list_free_full (pulse->priv->ext_streams_list, g_object_unref); - - pulse->priv->ext_streams_list = NULL; -} - static gboolean compare_stream_names (gpointer key, gpointer value, gpointer user_data) { diff --git a/backends/pulse/pulse-device-switch.c b/backends/pulse/pulse-device-switch.c index 4bd32ce..e8ba092 100644 --- a/backends/pulse/pulse-device-switch.c +++ b/backends/pulse/pulse-device-switch.c @@ -79,10 +79,8 @@ pulse_device_switch_dispose (GObject *object) swtch = PULSE_DEVICE_SWITCH (object); - if (swtch->priv->profiles != NULL) { - g_list_free_full (swtch->priv->profiles, g_object_unref); - swtch->priv->profiles = NULL; - } + _mate_mixer_clear_object_list (&swtch->priv->profiles); + G_OBJECT_CLASS (pulse_device_switch_parent_class)->dispose (object); } diff --git a/backends/pulse/pulse-device.c b/backends/pulse/pulse-device.c index c65f304..8735071 100644 --- a/backends/pulse/pulse-device.c +++ b/backends/pulse/pulse-device.c @@ -78,8 +78,6 @@ static const GList * pulse_device_list_switches (MateMixerDevice *mmd); static void pulse_device_load (PulseDevice *device, const pa_card_info *info); -static void free_list_streams (PulseDevice *device); - static void pulse_device_class_init (PulseDeviceClass *klass) { @@ -198,13 +196,10 @@ pulse_device_dispose (GObject *object) g_clear_object (&device->priv->connection); g_clear_object (&device->priv->pswitch); + g_clear_pointer (&device->priv->pswitch_list, g_list_free); - free_list_streams (device); + _mate_mixer_clear_object_list (&device->priv->streams_list); - if (device->priv->pswitch_list != NULL) { - g_list_free (device->priv->pswitch_list); - device->priv->pswitch_list = NULL; - } G_OBJECT_CLASS (pulse_device_parent_class)->dispose (object); } @@ -284,7 +279,7 @@ pulse_device_add_stream (PulseDevice *device, PulseStream *stream) g_strdup (name), g_object_ref (stream)); - free_list_streams (device); + _mate_mixer_clear_object_list (&device->priv->streams_list); g_signal_emit_by_name (G_OBJECT (device), "stream-added", @@ -304,7 +299,7 @@ pulse_device_remove_stream (PulseDevice *device, PulseStream *stream) g_object_ref (stream); g_hash_table_remove (device->priv->streams, name); - free_list_streams (device); + _mate_mixer_clear_object_list (&device->priv->streams_list); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", MATE_MIXER_STREAM (stream)); @@ -428,14 +423,3 @@ pulse_device_load (PulseDevice *device, const pa_card_info *info) g_object_unref (profile); } } - -static void -free_list_streams (PulseDevice *device) -{ - if (device->priv->streams_list == NULL) - return; - - g_list_free_full (device->priv->streams_list, g_object_unref); - - device->priv->streams_list = NULL; -} diff --git a/backends/pulse/pulse-port-switch.c b/backends/pulse/pulse-port-switch.c index 1f4ce67..c024d03 100644 --- a/backends/pulse/pulse-port-switch.c +++ b/backends/pulse/pulse-port-switch.c @@ -79,10 +79,8 @@ pulse_port_switch_dispose (GObject *object) swtch = PULSE_PORT_SWITCH (object); - if (swtch->priv->ports != NULL) { - g_list_free_full (swtch->priv->ports, g_object_unref); - swtch->priv->ports = NULL; - } + _mate_mixer_clear_object_list (&swtch->priv->ports); + G_OBJECT_CLASS (pulse_port_switch_parent_class)->dispose (object); } diff --git a/backends/pulse/pulse-sink.c b/backends/pulse/pulse-sink.c index 9edf185..c698d02 100644 --- a/backends/pulse/pulse-sink.c +++ b/backends/pulse/pulse-sink.c @@ -54,8 +54,6 @@ G_DEFINE_TYPE (PulseSink, pulse_sink, PULSE_TYPE_STREAM); static const GList *pulse_sink_list_controls (MateMixerStream *mms); static const GList *pulse_sink_list_switches (MateMixerStream *mms); -static void free_list_controls (PulseSink *sink); - static void pulse_sink_class_init (PulseSinkClass *klass) { @@ -99,13 +97,10 @@ pulse_sink_dispose (GObject *object) g_clear_object (&sink->priv->control); g_clear_object (&sink->priv->pswitch); + g_clear_pointer (&sink->priv->pswitch_list, g_list_free); - free_list_controls (sink); + _mate_mixer_clear_object_list (&sink->priv->inputs_list); - if (sink->priv->pswitch_list != NULL) { - g_list_free (sink->priv->pswitch_list); - sink->priv->pswitch_list = NULL; - } G_OBJECT_CLASS (pulse_sink_parent_class)->dispose (object); } @@ -207,7 +202,7 @@ pulse_sink_add_input (PulseSink *sink, const pa_sink_input_info *info) GUINT_TO_POINTER (info->index), input); - free_list_controls (sink); + _mate_mixer_clear_object_list (&sink->priv->inputs_list); g_signal_emit_by_name (G_OBJECT (sink), "control-added", @@ -233,7 +228,7 @@ pulse_sink_remove_input (PulseSink *sink, guint32 index) g_object_ref (input); g_hash_table_remove (sink->priv->inputs, GUINT_TO_POINTER (index)); - free_list_controls (sink); + _mate_mixer_clear_object_list (&sink->priv->inputs_list); g_signal_emit_by_name (G_OBJECT (sink), "control-removed", MATE_MIXER_STREAM_CONTROL (input)); @@ -292,14 +287,3 @@ pulse_sink_list_switches (MateMixerStream *mms) return PULSE_SINK (mms)->priv->pswitch_list; } - -static void -free_list_controls (PulseSink *sink) -{ - if (sink->priv->inputs_list == NULL) - return; - - g_list_free_full (sink->priv->inputs_list, g_object_unref); - - sink->priv->inputs_list = NULL; -} diff --git a/backends/pulse/pulse-source.c b/backends/pulse/pulse-source.c index 6393743..1c4e01a 100644 --- a/backends/pulse/pulse-source.c +++ b/backends/pulse/pulse-source.c @@ -53,8 +53,6 @@ G_DEFINE_TYPE (PulseSource, pulse_source, PULSE_TYPE_STREAM); static const GList *pulse_source_list_controls (MateMixerStream *mms); static const GList *pulse_source_list_switches (MateMixerStream *mms); -static void free_list_controls (PulseSource *source); - static void pulse_source_class_init (PulseSourceClass *klass) { @@ -96,13 +94,10 @@ pulse_source_dispose (GObject *object) g_clear_object (&source->priv->control); g_clear_object (&source->priv->pswitch); + g_clear_pointer (&source->priv->pswitch_list, g_list_free); - free_list_controls (source); + _mate_mixer_clear_object_list (&source->priv->outputs_list); - if (source->priv->pswitch_list != NULL) { - g_list_free (source->priv->pswitch_list); - source->priv->pswitch_list = NULL; - } G_OBJECT_CLASS (pulse_source_parent_class)->dispose (object); } @@ -203,7 +198,7 @@ pulse_source_add_output (PulseSource *source, const pa_source_output_info *info) GUINT_TO_POINTER (info->index), output); - free_list_controls (source); + _mate_mixer_clear_object_list (&source->priv->outputs_list); g_signal_emit_by_name (G_OBJECT (source), "control-added", @@ -229,7 +224,7 @@ pulse_source_remove_output (PulseSource *source, guint32 index) g_object_ref (output); g_hash_table_remove (source->priv->outputs, GUINT_TO_POINTER (index)); - free_list_controls (source); + _mate_mixer_clear_object_list (&source->priv->outputs_list); g_signal_emit_by_name (G_OBJECT (source), "control-removed", MATE_MIXER_STREAM_CONTROL (output)); @@ -279,14 +274,3 @@ pulse_source_list_switches (MateMixerStream *mms) return PULSE_SOURCE (mms)->priv->pswitch_list; } - -static void -free_list_controls (PulseSource *source) -{ - if (source->priv->outputs_list == NULL) - return; - - g_list_free_full (source->priv->outputs_list, g_object_unref); - - source->priv->outputs_list = NULL; -} -- cgit v1.2.1