diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index b2c28ef..3a4fcf6 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -752,13 +752,6 @@ internal class Vala.CCodeMethodModule : CCodeStructModule { var main_block = new CCodeBlock (); if (context.profile == Profile.GOBJECT) { - if (context.thread) { - var thread_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_thread_init")); - thread_init_call.line = cmain.line; - thread_init_call.add_argument (new CCodeConstant ("NULL")); - main_block.add_statement (new CCodeExpressionStatement (thread_init_call)); - } - if (context.mem_profiler) { var mem_profiler_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_mem_set_vtable")); mem_profiler_init_call.line = cmain.line; @@ -766,6 +759,13 @@ internal class Vala.CCodeMethodModule : CCodeStructModule { main_block.add_statement (new CCodeExpressionStatement (mem_profiler_init_call)); } + if (context.thread) { + var thread_init_call = new CCodeFunctionCall (new CCodeIdentifier ("g_thread_init")); + thread_init_call.line = cmain.line; + thread_init_call.add_argument (new CCodeConstant ("NULL")); + main_block.add_statement (new CCodeExpressionStatement (thread_init_call)); + } + var type_init_call = new CCodeExpressionStatement (new CCodeFunctionCall (new CCodeIdentifier ("g_type_init"))); type_init_call.line = cmain.line; main_block.add_statement (type_init_call);