]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Never try to use GValue take functions for primitive types
authorJürg Billeter <j@bitron.ch>
Fri, 26 Mar 2010 07:59:49 +0000 (08:59 +0100)
committerJürg Billeter <j@bitron.ch>
Fri, 26 Mar 2010 08:03:42 +0000 (09:03 +0100)
codegen/valaccodebasemodule.vala
tests/structs/gvalue.vala

index f839654adfb23633f611332ed02843b675720f65..01e5fa6dc7f797068609183d29d8de65cf83799d 100644 (file)
@@ -4991,7 +4991,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
                        ccall.add_argument (new CCodeIdentifier (expression_type.get_type_id ()));
                        ccomma.append_expression (ccall);
 
-                       if (expression_type.value_owned) {
+                       if (requires_destroy (expression_type)) {
                                ccall = new CCodeFunctionCall (get_value_taker_function (expression_type));
                        } else {
                                ccall = new CCodeFunctionCall (get_value_setter_function (expression_type));
index 132af3d450aee36f6f880301e7b12f71d6736bd3..c17c9d9c9fa3fb2f8c8292ac75611cb9afac1ea1 100644 (file)
@@ -48,9 +48,17 @@ void test_nullable_value_array () {
        }
 }
 
+void take_value (Value v) {
+}
+
+bool make_bool () {
+       return true;
+}
+
 void main () {
        test_value ();
        test_value_array ();
        test_nullable_value ();
        test_nullable_value_array ();
+       take_value (make_bool ());
 }