[vala/wip/attributes: 27/27] codegen: Add get_ccode_has_destroy_function
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/attributes: 27/27] codegen: Add get_ccode_has_destroy_function
- Date: Tue, 28 Jun 2011 13:17:50 +0000 (UTC)
commit e5dbd54ff72caaaf367542af364e5add06ffc994
Author: Luca Bruno <lucabru src gnome org>
Date: Tue Jun 28 15:11:12 2011 +0200
codegen: Add get_ccode_has_destroy_function
codegen/valaccodebasemodule.vala | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index fe0e0a7..8f3356c 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2594,7 +2594,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
} else {
var st = type.data_type as Struct;
if (st != null && st.is_disposable ()) {
- if (!st.has_destroy_function) {
+ if (!get_ccode_has_destroy_function (st)) {
generate_struct_destroy_function (st);
}
@@ -2696,7 +2696,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
} else {
var st = (Struct) type.data_type;
- if (!st.has_destroy_function) {
+ if (!get_ccode_has_destroy_function (st)) {
generate_struct_destroy_function (st);
}
unref_function = st.get_destroy_function ();
@@ -5680,6 +5680,11 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
return a != null && a.get_bool ("has_copy_function");
}
+ public static bool get_ccode_has_destroy_function (Struct st) {
+ var a = st.get_attribute ("CCode");
+ return a != null && a.get_bool ("has_destroy_function");
+ }
+
public override void visit_class (Class cl) {
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]