script: Fix a segfault

Accessing a variable before it is being set is not a great plan.
This commit is contained in:
Emmanuele Bassi 2012-01-17 14:17:20 +00:00
parent 37d94c6b87
commit 9f0ba2da0f

View File

@ -2000,7 +2000,7 @@ _clutter_script_construct_object (ClutterScript *script,
else else
{ {
GList *properties = oinfo->properties; GList *properties = oinfo->properties;
GParameter *parameters = (GParameter *) (void *) params->data; GParameter *parameters;
/* every other object: first, we get the construction parameters */ /* every other object: first, we get the construction parameters */
oinfo->properties = oinfo->properties =
@ -2010,6 +2010,7 @@ _clutter_script_construct_object (ClutterScript *script,
properties, properties,
&params); &params);
parameters = (GParameter *) (void *) params->data;
oinfo->object = g_object_newv (oinfo->gtype, oinfo->object = g_object_newv (oinfo->gtype,
params->len, params->len,
parameters); parameters);