mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
gvalue: Static strings should not be copied
When doing copies of GValue backed by static strings, the contents should not be copied
This commit is contained in:
parent
e4c3af9d4e
commit
e3efbd30a2
@ -271,7 +271,16 @@ static void
|
||||
value_copy_string (const GValue *src_value,
|
||||
GValue *dest_value)
|
||||
{
|
||||
dest_value->data[0].v_pointer = g_strdup (src_value->data[0].v_pointer);
|
||||
if (src_value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS)
|
||||
{
|
||||
dest_value->data[0].v_pointer = src_value->data[0].v_pointer;
|
||||
dest_value->data[1].v_uint = src_value->data[1].v_uint;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest_value->data[0].v_pointer = g_strdup (src_value->data[0].v_pointer);
|
||||
dest_value->data[1].v_uint = src_value->data[1].v_uint;
|
||||
}
|
||||
}
|
||||
|
||||
static gchar*
|
||||
|
Loading…
Reference in New Issue
Block a user