+2007-10-12 Emmanuele Bassi <ebassi@openedhand.com>
+
+ * clutter/clutter-script.c (construct_timline),
+ (parse_member_to_property): Transfer ownership of the
+ implicit timelines to the behaviour, so that they get
+ unreferenced when the behaviour is destroyed.
+
+ (parse_member_to_property): Reverse the list of children
+ and behaviours.
+
2007-10-12 Tomas Frydrych <tf@o-hand.com>
Portability fixes:
guint last_merge_id;
JsonParser *parser;
- ObjectInfo *current;
gchar *filename;
guint is_filename : 1;
retval = CLUTTER_TIMELINE (clutter_script_construct_object (script, oinfo));
- /* it needs to survive */
- g_object_ref (retval);
+ /* we transfer ownership to the alpha function later */
+ oinfo->is_toplevel = FALSE;
object_info_free (oinfo);
return retval;
ClutterTimeline *timeline = NULL;
ClutterAlphaFunc func = NULL;
JsonNode *val;
+ gboolean unref_timeline = FALSE;
retval = g_slice_new (PropertyInfo);
retval->property_name = g_strdup (name);
CLUTTER_TIMELINE (clutter_script_get_object (script, id));
}
else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT)
- timeline = construct_timeline (script, json_node_get_object (val));
+ {
+ timeline = construct_timeline (script, json_node_get_object (val));
+ unref_timeline = TRUE;
+ }
}
val = json_object_get_member (object, "function");
if (val && json_node_get_string (val) != NULL)
func = resolve_alpha_func (json_node_get_string (val));
- alpha = g_object_new (CLUTTER_TYPE_ALPHA,
- "timeline", timeline,
- NULL);
+ alpha = g_object_new (CLUTTER_TYPE_ALPHA, NULL);
clutter_alpha_set_func (alpha, func, NULL, NULL);
+ clutter_alpha_set_timeline (alpha, timeline);
+ if (unref_timeline)
+ g_object_unref (timeline);
g_value_init (&retval->value, CLUTTER_TYPE_ALPHA);
g_value_set_object (&retval->value, G_OBJECT (alpha));
}
if (name[0] == 'c') /* children */
- info->children = children;
+ info->children = g_list_reverse (children);
else
- info->behaviours = children;
+ info->behaviours = g_list_reverse (children);
}
break;