[rhythmbox/v0.13.x] mpris: Fix property values lifecycle



commit 2597221ac6fe68a35268b66c94342554b547ac80
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 24 03:08:41 2011 +0000

    mpris: Fix property values lifecycle
    
    Thanks to Ryan Lortie

 plugins/mpris/rb-mpris-plugin.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/mpris/rb-mpris-plugin.c b/plugins/mpris/rb-mpris-plugin.c
index 12c3ae1..5b3decc 100644
--- a/plugins/mpris/rb-mpris-plugin.c
+++ b/plugins/mpris/rb-mpris-plugin.c
@@ -177,9 +177,9 @@ add_player_property_change (RBMprisPlugin *plugin,
 			    GVariant *value)
 {
 	if (plugin->player_property_changes == NULL) {
-		plugin->player_property_changes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+		plugin->player_property_changes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_variant_unref);
 	}
-	g_hash_table_insert (plugin->player_property_changes, g_strdup (property), value);
+	g_hash_table_insert (plugin->player_property_changes, g_strdup (property), g_variant_ref_sink (value));
 
 	if (plugin->property_emit_id == 0) {
 		plugin->property_emit_id = g_idle_add ((GSourceFunc)emit_properties_idle, plugin);
@@ -192,9 +192,9 @@ add_playlist_property_change (RBMprisPlugin *plugin,
 			      GVariant *value)
 {
 	if (plugin->playlist_property_changes == NULL) {
-		plugin->playlist_property_changes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+		plugin->playlist_property_changes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_variant_unref);
 	}
-	g_hash_table_insert (plugin->playlist_property_changes, g_strdup (property), value);
+	g_hash_table_insert (plugin->playlist_property_changes, g_strdup (property), g_variant_ref_sink (value));
 
 	if (plugin->property_emit_id == 0) {
 		plugin->property_emit_id = g_idle_add ((GSourceFunc)emit_properties_idle, plugin);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]