@@ -184,25 +184,21 @@ array_get_or_set_length (GITypeInfo *ti, gssize *get_length, gssize set_length,
184184
185185 if (GI_IS_FUNCTION_INFO (ci ) || GI_IS_CALLBACK_INFO (ci ))
186186 {
187- GIArgInfo ai ;
187+ GIArgInfo * ai ;
188188
189189 if (param >= gi_callable_info_get_n_args (GI_CALLABLE_INFO (ci )))
190190 return ;
191- gi_callable_info_load_arg (GI_CALLABLE_INFO (ci ), param , & ai );
192- eti = gi_arg_info_get_type_info (& ai );
193- /* Without explicitly incrementing the ref count on eti, it will be
194- made into garbage when clearing ai. */
195- gi_base_info_ref (eti );
196- if (gi_arg_info_get_direction (& ai ) == GI_DIRECTION_IN )
191+ ai = gi_callable_info_get_arg (GI_CALLABLE_INFO (ci ), param );
192+ eti = gi_arg_info_get_type_info (ai );
193+ if (gi_arg_info_get_direction (ai ) == GI_DIRECTION_IN )
197194 /* For input parameters, value is directly pointed to by args
198195 table element. */
199196 val = (GIArgument * ) ((void * * ) args )[param ];
200197 else
201198 /* For output arguments, args table element points to pointer
202199 to value. */
203200 val = * (GIArgument * * ) ((void * * ) args )[param ];
204-
205- gi_base_info_clear (& ai );
201+ gi_base_info_unref (ai );
206202 }
207203 else if (GI_IS_STRUCT_INFO (ci ) || GI_IS_UNION_INFO (ci ))
208204 {
@@ -507,9 +503,8 @@ marshal_2lua_array (lua_State *L, GITypeInfo *ti, GIDirection dir,
507503 {
508504 if (!gi_type_info_get_array_fixed_size (ti , (gsize * )& len ))
509505 /* Length of the array is dynamic, get it from other
510- argument. If the size isn't known ahead of time (it's -1),
511- and it isn't zero-terminated, assume 1. */
512- len = size < 0 ? 1 : size ;
506+ argument. */
507+ len = size ;
513508 }
514509 }
515510
0 commit comments