diff options
author | Michal Ratajsky <[email protected]> | 2016-01-09 20:25:33 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-02-21 11:55:59 +0100 |
commit | 9cbe39ab7c55bcad401de32716c5c8106f166291 (patch) | |
tree | 42fb4f92923890f6c3070e95f5ff0ba88358da46 /backends/oss/oss-switch.c | |
parent | d1deea43570dfd5bd32b7040f89cf3c971df3b9a (diff) | |
download | libmatemixer-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.c | 11 |
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 |