mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-24 10:57:53 +02:00
GVariant: add new g_variant_new_take_string() API
Lots of people have variously asked for APIs like g_variant_new_string_printf() in order to avoid having to use g_strdup_printf(), create a GVariant using g_variant_new_string(), then free the temporary string. Instead of supporting that, plus a million other potential cases, introduce g_variant_new_take_string() as a compromise. It's not possible to write: v = g_variant_new_take_string (g_strdup_printf (....)); to get the desired result and avoid the extra copies. In addition, it works with many other functions. https://bugzilla.gnome.org/show_bug.cgi?id=698455
This commit is contained in:
@@ -3108,6 +3108,7 @@ g_variant_new_uint64
|
||||
g_variant_new_handle
|
||||
g_variant_new_double
|
||||
g_variant_new_string
|
||||
g_variant_new_take_string
|
||||
g_variant_new_object_path
|
||||
g_variant_is_object_path
|
||||
g_variant_new_signature
|
||||
|
Reference in New Issue
Block a user