diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-09-06 12:14:38 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-09-06 12:14:38 +0200 |
commit | aa830233ca58715674aa6ef48ae6dad38d27c176 (patch) | |
tree | 2c18e924214d1917d7dc5350dc486b8bb4f7d4ac | |
parent | fde79fff1fddbf747915cf0fe477435a6dc479f8 (diff) | |
download | ayatana-indicator-messages-aa830233ca58715674aa6ef48ae6dad38d27c176.tar.gz ayatana-indicator-messages-aa830233ca58715674aa6ef48ae6dad38d27c176.tar.bz2 ayatana-indicator-messages-aa830233ca58715674aa6ef48ae6dad38d27c176.zip |
im_application_list_update_draws_attention: fix GVariant leak
g_icon_serialize() returns a full (not a floating) reference.
-rw-r--r-- | src/im-application-list.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c index ce463fb..6b2da3f 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -161,6 +161,7 @@ im_application_list_update_draws_attention (ImApplicationList *list) const gchar *accessible_name; const gchar *icon_name; GIcon * icon; + GVariant *serialized_icon; GVariantBuilder builder; GVariant *state; @@ -182,12 +183,13 @@ im_application_list_update_draws_attention (ImApplicationList *list) g_variant_builder_init(&builder, G_VARIANT_TYPE_DICTIONARY); /* icon */ - g_variant_builder_open(&builder, G_VARIANT_TYPE_DICT_ENTRY); - g_variant_builder_add_value(&builder, g_variant_new_string("icon")); icon = g_themed_icon_new_with_default_fallbacks(icon_name); - g_variant_builder_add_value(&builder, g_variant_new_variant(g_icon_serialize(icon))); + if ((serialized_icon = g_icon_serialize(icon))) + { + g_variant_builder_add (&builder, "{sv}", "icon", serialized_icon); + g_variant_unref (serialized_icon); + } g_object_unref(icon); - g_variant_builder_close(&builder); /* accessible description */ g_variant_builder_open(&builder, G_VARIANT_TYPE_DICT_ENTRY); |