mirror of
https://github.com/brl/mutter.git
synced 2025-01-26 19:39:20 +00:00
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:
parent
10963d1ae0
commit
2aa9d7bdc7
@ -707,7 +707,7 @@ construct_timeline (ClutterScript *script,
|
|||||||
PropertyInfo *pinfo = g_slice_new0 (PropertyInfo);
|
PropertyInfo *pinfo = g_slice_new0 (PropertyInfo);
|
||||||
|
|
||||||
pinfo->name = g_strdelimit (g_strdup (name), G_STR_DELIMITERS, '-');
|
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);
|
oinfo->properties = g_list_prepend (oinfo->properties, pinfo);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user