summaryrefslogtreecommitdiff
path: root/backends/oss/oss-switch.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2016-01-09 20:25:33 +0100
committerraveit65 <[email protected]>2017-02-21 11:55:59 +0100
commit9cbe39ab7c55bcad401de32716c5c8106f166291 (patch)
tree42fb4f92923890f6c3070e95f5ff0ba88358da46 /backends/oss/oss-switch.c
parentd1deea43570dfd5bd32b7040f89cf3c971df3b9a (diff)
downloadlibmatemixer-9cbe39ab7c55bcad401de32716c5c8106f166291.tar.bz2
libmatemixer-9cbe39ab7c55bcad401de32716c5c8106f166291.tar.xz
Provide and use convenience functions to remove some copy-pasted code
Diffstat (limited to 'backends/oss/oss-switch.c')
-rw-r--r--backends/oss/oss-switch.c11
1 files changed, 2 insertions, 9 deletions
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