[vala] codegen: Do not generate generic destroy func for non-disposable structs
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Do not generate generic destroy func for non-disposable structs
- Date: Sat, 5 Apr 2014 16:37:13 +0000 (UTC)
commit c045337110c90786ddb03cac511787252b948655
Author: Simon Werbeck <simon werbeck gmail com>
Date: Sat Apr 5 13:11:51 2014 +0200
codegen: Do not generate generic destroy func for non-disposable structs
Fixes bug 727652
codegen/valaccodebasemodule.vala | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 8e844a6..8b097f5 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3115,10 +3115,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
unref_function = null;
} else {
var st = (Struct) type.data_type;
- if (!get_ccode_has_destroy_function (st)) {
- generate_struct_destroy_function (st);
+ if (st.is_disposable ()) {
+ if (!get_ccode_has_destroy_function (st)) {
+ generate_struct_destroy_function (st);
+ }
+ unref_function = get_ccode_destroy_function (st);
+ } else {
+ unref_function = null;
}
- unref_function = get_ccode_destroy_function (st);
}
}
if (unref_function == null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]