summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-08-21 17:11:44 +0200
committerMichal Ratajsky <[email protected]>2014-08-21 17:11:44 +0200
commitb6955dd78085d642f10325ec6d929e7421224d74 (patch)
tree13b0ef3242b87ba6343316d30159680e77fc4a26 /backends
parent3a99c51bb0bcba28d0d38bbed937c2071d9666b2 (diff)
downloadlibmatemixer-b6955dd78085d642f10325ec6d929e7421224d74.tar.bz2
libmatemixer-b6955dd78085d642f10325ec6d929e7421224d74.tar.xz
Fix memory problems in ALSA and MateMixerToggle and rename toggle option properties
Diffstat (limited to 'backends')
-rw-r--r--backends/alsa/alsa-backend.c10
-rw-r--r--backends/alsa/alsa-device.c2
-rw-r--r--backends/alsa/alsa-toggle.c4
-rw-r--r--backends/oss/oss-backend.c1
4 files changed, 10 insertions, 7 deletions
diff --git a/backends/alsa/alsa-backend.c b/backends/alsa/alsa-backend.c
index 6bac691..2493d45 100644
--- a/backends/alsa/alsa-backend.c
+++ b/backends/alsa/alsa-backend.c
@@ -363,10 +363,12 @@ read_device (AlsaBackend *alsa, const gchar *card)
static void
add_device (AlsaBackend *alsa, AlsaDevice *device)
{
- alsa->priv->devices = g_list_insert_sorted_with_data (alsa->priv->devices,
- device,
- (GCompareDataFunc) compare_devices,
- NULL);
+ /* Takes reference of device */
+ alsa->priv->devices =
+ g_list_insert_sorted_with_data (alsa->priv->devices,
+ device,
+ (GCompareDataFunc) compare_devices,
+ NULL);
/* Keep track of device identifiers */
g_hash_table_add (alsa->priv->devices_ids, g_strdup (ALSA_DEVICE_GET_ID (device)));
diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c
index f7f705e..03dd7c0 100644
--- a/backends/alsa/alsa-device.c
+++ b/backends/alsa/alsa-device.c
@@ -230,7 +230,7 @@ alsa_device_finalize (GObject *object)
close_mixer (device);
- G_OBJECT_CLASS (alsa_device_parent_class)->dispose (object);
+ G_OBJECT_CLASS (alsa_device_parent_class)->finalize (object);
}
AlsaDevice *
diff --git a/backends/alsa/alsa-toggle.c b/backends/alsa/alsa-toggle.c
index a7958c9..c843985 100644
--- a/backends/alsa/alsa-toggle.c
+++ b/backends/alsa/alsa-toggle.c
@@ -92,8 +92,8 @@ alsa_toggle_new (const gchar *name,
"label", label,
"flags", MATE_MIXER_SWITCH_TOGGLE,
"role", role,
- "state-option-on", on,
- "state-option-off", off,
+ "on-state-option", on,
+ "off-state-option", off,
NULL);
toggle->priv->type = type;
diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c
index 23d265b..bf9a694 100644
--- a/backends/oss/oss-backend.c
+++ b/backends/oss/oss-backend.c
@@ -461,6 +461,7 @@ read_device_label_sndstat (OssBackend *oss,
static void
add_device (OssBackend *oss, OssDevice *device)
{
+ /* Takes reference of device */
oss->priv->devices =
g_list_insert_sorted_with_data (oss->priv->devices,
device,