summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-backend.c
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/alsa/alsa-backend.c
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/alsa/alsa-backend.c')
-rw-r--r--backends/alsa/alsa-backend.c10
1 files changed, 6 insertions, 4 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)));