[rhythmbox] mpris: Fix property values lifecycle



commit 0af2d16438155d0c4099533141236245c93d4150
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 3c5ead1..5c0c6a5 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]