From a96983dbe6079ff7c174d5dc536d35eb4b2d4bd4 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Fri, 13 Jul 2018 19:50:22 +0200 Subject: [PATCH] codegen: Move interface_init calls before g_type_add_instance_private() --- codegen/valatyperegisterfunction.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) { -- 2.11.4.GIT