[vala] codegen: Generate struct copy and destroy functions only if needed
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Generate struct copy and destroy functions only if needed
- Date: Tue, 21 Dec 2010 21:35:45 +0000 (UTC)
commit c0d3a4fd1ff8c88c5530d41d22fa6ffebb3bbfdd
Author: Jürg Billeter <j bitron ch>
Date: Tue Dec 21 22:32:04 2010 +0100
codegen: Generate struct copy and destroy functions only if needed
codegen/valaccodestructmodule.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodestructmodule.vala b/codegen/valaccodestructmodule.vala
index bf94ec6..555ef07 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]