]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Generate struct copy and destroy functions only if needed
authorJürg Billeter <j@bitron.ch>
Tue, 21 Dec 2010 21:32:04 +0000 (22:32 +0100)
committerJürg Billeter <j@bitron.ch>
Tue, 21 Dec 2010 21:32:04 +0000 (22:32 +0100)
codegen/valaccodestructmodule.vala

index bf94ec6bc2f603cf9a1f87540b30d337d3e0dcd0..555ef077eb3ba90ef30e8763898718acba28c8db 100644 (file)
@@ -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);