]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GVariant: Fix serialization of empty hash tables
authorJürg Billeter <j@bitron.ch>
Wed, 29 Dec 2010 18:36:05 +0000 (19:36 +0100)
committerJürg Billeter <j@bitron.ch>
Wed, 29 Dec 2010 18:36:05 +0000 (19:36 +0100)
codegen/valagvariantmodule.vala

index 2b968aa3938c44f4bda7fddb0ad753e60dd4cb26..2844e1ef0918dfb5a02fc0a716d8a4618a8f7108 100644 (file)
@@ -680,9 +680,12 @@ public class Vala.GVariantModule : GAsyncModule {
                iter_init_call.add_argument (hash_table_expr);
                ccode.add_expression (iter_init_call);
 
+               var gvariant_type = new CCodeFunctionCall (new CCodeIdentifier ("G_VARIANT_TYPE"));
+               gvariant_type.add_argument (new CCodeConstant ("\"%s\"".printf (get_type_signature (type))));
+
                var iter_call = new CCodeFunctionCall (new CCodeIdentifier ("g_variant_builder_init"));
                iter_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (subiter_name)));
-               iter_call.add_argument (new CCodeIdentifier ("G_VARIANT_TYPE_DICTIONARY"));
+               iter_call.add_argument (gvariant_type);
                ccode.add_expression (iter_call);
 
                var iter_next_call = new CCodeFunctionCall (new CCodeIdentifier ("g_hash_table_iter_next"));