script: Take a copy of property nodes

Instead of counting on a JsonNode pointer to survive we should take
a copy. This allows keeping unresolved properties across different
ClutterScript passes.
This commit is contained in:
Emmanuele Bassi 2009-11-03 18:30:28 +00:00
parent 4ad57aa3e4
commit 6e571928a4

View File

@ -804,7 +804,7 @@ json_object_end (JsonParser *parser,
pinfo = g_slice_new (PropertyInfo); pinfo = g_slice_new (PropertyInfo);
pinfo->name = g_strdup (name); pinfo->name = g_strdup (name);
pinfo->node = node; pinfo->node = json_node_copy (node);
pinfo->pspec = NULL; pinfo->pspec = NULL;
oinfo->properties = g_list_prepend (oinfo->properties, pinfo); oinfo->properties = g_list_prepend (oinfo->properties, pinfo);
@ -1618,6 +1618,9 @@ property_info_free (gpointer data)
{ {
PropertyInfo *pinfo = data; PropertyInfo *pinfo = data;
if (pinfo->node)
json_node_free (pinfo->node);
if (pinfo->pspec) if (pinfo->pspec)
g_param_spec_unref (pinfo->pspec); g_param_spec_unref (pinfo->pspec);