From: Rico Tzschichholz Date: Fri, 13 Jul 2018 17:50:22 +0000 (+0200) Subject: codegen: Move interface_init calls before g_type_add_instance_private() X-Git-Tag: 0.41.90~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a96983dbe6079ff7c174d5dc536d35eb4b2d4bd4;p=thirdparty%2Fvala.git codegen: Move interface_init calls before g_type_add_instance_private() --- diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index c1811d949..cb0db6844 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -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) {