From: Jürg Billeter Date: Tue, 21 Dec 2010 21:32:04 +0000 (+0100) Subject: codegen: Generate struct copy and destroy functions only if needed X-Git-Tag: 0.11.3~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0d3a4fd1ff8c88c5530d41d22fa6ffebb3bbfdd;p=thirdparty%2Fvala.git codegen: Generate struct copy and destroy functions only if needed --- diff --git a/codegen/valaccodestructmodule.vala b/codegen/valaccodestructmodule.vala index bf94ec6bc..555ef077e 100644 --- a/codegen/valaccodestructmodule.vala +++ b/codegen/valaccodestructmodule.vala @@ -154,7 +154,11 @@ public abstract class Vala.CCodeStructModule : CCodeBaseModule { generate_struct_declaration (st, internal_header_file); } - begin_struct_destroy_function (st); + if (context.profile == Profile.GOBJECT && !st.is_boolean_type () && !st.is_integer_type () && !st.is_floating_type ()) { + if (st.is_disposable ()) { + begin_struct_destroy_function (st); + } + } st.accept_children (this);