1
0
Fork 0

script: Copy the JSON node in PropertyInfo

PropertyInfo should store a copy of the JsonNodes it references, so
that property_info_free() can safely dispose them, and we can reference
values across different UI definition data.

The implicit timeline parsing code is not copying the JsonNode; this
leads to a double free in some cases, which is masked by the GSlice
allocator and produces a heap corruption later on.
This commit is contained in:
Emmanuele Bassi 2010-01-05 10:55:28 +00:00
parent 10963d1ae0
commit 2aa9d7bdc7

View file

@ -707,7 +707,7 @@ construct_timeline (ClutterScript *script,
PropertyInfo *pinfo = g_slice_new0 (PropertyInfo);
pinfo->name = g_strdelimit (g_strdup (name), G_STR_DELIMITERS, '-');
pinfo->node = node;
pinfo->node = json_node_copy (node);
oinfo->properties = g_list_prepend (oinfo->properties, pinfo);
}