mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-16 10:50:43 +03:00
libotutil: Make use of GBytes in ot_variant_read()
This is just cleaner; we avoid using GObject data, etc. https://bugzilla.gnome.org/show_bug.cgi?id=706031
This commit is contained in:
parent
d9f59c6fd5
commit
c77908bf51
@ -180,12 +180,12 @@ GInputStream *
|
||||
ot_variant_read (GVariant *variant)
|
||||
{
|
||||
GMemoryInputStream *ret = NULL;
|
||||
gs_unref_bytes GBytes *bytes = NULL;
|
||||
|
||||
bytes = g_variant_get_data_as_bytes (variant);
|
||||
ret = (GMemoryInputStream*)g_memory_input_stream_new ();
|
||||
g_memory_input_stream_add_bytes (ret, bytes);
|
||||
|
||||
ret = (GMemoryInputStream*)g_memory_input_stream_new_from_data (g_variant_get_data (variant),
|
||||
g_variant_get_size (variant),
|
||||
NULL);
|
||||
g_object_set_data_full ((GObject*)ret, "ot-variant-data",
|
||||
g_variant_ref (variant), (GDestroyNotify) g_variant_unref);
|
||||
return (GInputStream*)ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user