It is required to deal with special free functions here.
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1201
type = pointer_type.base_type;
}
- var ccall = new CCodeFunctionCall (get_destroy_func_expression (type));
- ccall.add_argument (get_cvalue (stmt.expression));
- ccode.add_expression (ccall);
+ ccode.add_expression (destroy_value (new GLibValue (type, get_cvalue (stmt.expression))));
}
static bool is_compact_class_destructor_call (Expression expr) {
Bar* bar = new Bar ();
delete bar;
}
+ {
+ StringBuilder* foo = new StringBuilder ();
+ foo->append ("foo");
+ delete foo;
+ }
}