glib/docs
Philip Withnall d951db4236 gobject: Add g_set_object() convenience function to set GObject pointers
Along the same lines as g_clear_object(), g_set_object() is a
convenience function to update a GObject pointer, handling reference
counting transparently and correctly.

Specifically, it handles the case where a pointer is set to its current
value. If handled naïvely, that could result in the object instance
being finalised. In the following code, that happens when
(my_obj == new_value) and the object has a single reference:
    g_clear_object (&my_obj);
    my_obj = g_object_ref (new_value);

It also simplifies boilerplate code such as set_property()
implementations, which are otherwise long and boring.

Test cases included.

https://bugzilla.gnome.org/show_bug.cgi?id=741589
2014-12-18 11:32:56 +00:00
..
reference gobject: Add g_set_object() convenience function to set GObject pointers 2014-12-18 11:32:56 +00:00
debugging.txt Remove references to gruntime. This includes renaming the test program 2002-02-26 21:23:52 +00:00
macros.txt honour g_mem_gc_friendly settings when freeing slices, make sure 2006-01-25 15:51:43 +00:00
Makefile.am Removed obsolete makefile rules 2013-10-17 13:20:14 -04:00