rhythmbox r5764 - in trunk: . plugins/ipod



Author: teuf
Date: Fri Jun 20 18:11:51 2008
New Revision: 5764
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5764&view=rev

Log:
Explain the raison d'Ãtre of a non-obvious needed g_object_ref(_sink)


Modified:
   trunk/ChangeLog
   trunk/plugins/ipod/rb-ipod-source.c

Modified: trunk/plugins/ipod/rb-ipod-source.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-source.c	(original)
+++ trunk/plugins/ipod/rb-ipod-source.c	Fri Jun 20 18:11:51 2008
@@ -409,7 +409,11 @@
 		g_free (filename);
 	}
 
-	g_object_ref (G_OBJECT(playlist_source));
+        /* RBSource derives from GtkWidget so its initial reference is
+         * floating. Since we need a ref for ourselves and we don't want it to
+         * be stolen by a GtkContainer, we sink the floating reference.
+         */
+	g_object_ref_sink (G_OBJECT(playlist_source));
 	playlist->userdata = playlist_source;
 	playlist->userdata_destroy = g_object_unref;
 	playlist->userdata_duplicate = g_object_ref;



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