]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Move interface_init calls before g_type_add_instance_private()
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 13 Jul 2018 17:50:22 +0000 (19:50 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 13 Jul 2018 18:05:10 +0000 (20:05 +0200)
codegen/valatyperegisterfunction.vala

index c1811d9498560d93642c31b72cbd4560f58b4155..cb0db68443ba43895734f28674130a3da729eb65 100644 (file)
@@ -213,6 +213,10 @@ public abstract class Vala.TypeRegisterFunction {
                        type_init.add_statement (new CCodeExpressionStatement (add_class_private_call));
                }
 
+               if (!declaration_only) {
+                       get_type_interface_init_statements (context, type_init, plugin);
+               }
+
                if (cl != null && (cl.has_private_fields || cl.get_type_parameters ().size > 0)) {
                        var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_type_add_instance_private"));
                        ccall.add_argument (new CCodeIdentifier (type_id_name));
@@ -220,10 +224,6 @@ public abstract class Vala.TypeRegisterFunction {
                        type_init.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("%s_private_offset".printf (get_ccode_name (cl))), ccall)));
                }
 
-               if (!declaration_only) {
-                       get_type_interface_init_statements (context, type_init, plugin);
-               }
-
                if (!plugin) {
                        CCodeExpression condition; // the condition that guards the type initialisation
                        if (use_thread_safe) {