GVariant: add g_variant_take_ref()
authorRyan Lortie <desrt@desrt.ca>
Mon, 11 Jul 2011 12:27:53 +0000 (14:27 +0200)
committerRyan Lortie <desrt@desrt.ca>
Tue, 12 Jul 2011 17:44:21 +0000 (19:44 +0200)
commit58c247e51bfc7d7ff4ed3b351ba4fdab0f012bac
tree3a14bb7d2d99e469e452f238aec9d1956ba6a76e
parent2121e56ea7399091f6ef169a1da8a11aaa64b5c3
GVariant: add g_variant_take_ref()

This function implements the following logic:

  if (g_variant_is_floating (value))
    g_variant_ref_sink (value);

which is used for consuming the return value of callbacks that may or
may not return floating references.

This patch also replaces a few instances of the above code with the new
function (GSettings, GDBus) and lifts a long-standing restriction on the
use of floating values as the return value for signal handlers by
improving g_value_take_variant().

https://bugzilla.gnome.org/show_bug.cgi?id=627974
docs/reference/glib/glib-sections.txt
gio/gdbus-codegen/codegen.py
gio/gdbusconnection.c
gio/gsettings.c
glib/glib.symbols
glib/gvariant-core.c
glib/gvariant.h
gobject/gvaluetypes.c