[vala/0.40] codegen: Don't emit *_free() of derived compact classes
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] codegen: Don't emit *_free() of derived compact classes
- Date: Mon, 5 Nov 2018 08:13:23 +0000 (UTC)
commit 1f200bda5920b36db386869003892e067a1bb461
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Nov 4 22:49:04 2018 +0100
codegen: Don't emit *_free() of derived compact classes
Found with -Werror=missing-prototypes
codegen/valagtypemodule.vala | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 2f86e2d41..3aef3e1dc 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1773,7 +1773,7 @@ public class Vala.GTypeModule : GErrorModule {
call.add_argument (new CCodeIdentifier ("self"));
ccode.add_expression (call);
}
- } else {
+ } else if (cl.base_class == null) {
var function = new CCodeFunction ("%sfree".printf (get_ccode_lower_case_prefix (cl)),
"void");
if (cl.is_private_symbol ()) {
function.modifiers = CCodeModifiers.STATIC;
@@ -1821,6 +1821,7 @@ public class Vala.GTypeModule : GErrorModule {
}
cfile.add_function_declaration (instance_finalize_context.ccode);
+ cfile.add_function (instance_finalize_context.ccode);
} else if (cl.base_class == null) {
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_slice_free"));
ccall.add_argument (new CCodeIdentifier (get_ccode_name (cl)));
@@ -1828,9 +1829,11 @@ public class Vala.GTypeModule : GErrorModule {
push_context (instance_finalize_context);
ccode.add_expression (ccall);
pop_context ();
- }
- cfile.add_function (instance_finalize_context.ccode);
+ cfile.add_function (instance_finalize_context.ccode);
+ } else if (cl.base_class == gsource_type) {
+ cfile.add_function (instance_finalize_context.ccode);
+ }
}
public override CCodeExpression get_param_spec_cexpression (Property prop) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]