]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Check ownership for property getters in clients
authorJürg Billeter <j@bitron.ch>
Mon, 15 Jun 2009 16:21:35 +0000 (18:21 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 15 Jun 2009 16:21:35 +0000 (18:21 +0200)
Properties used in D-Bus clients require owned get accessor.

codegen/valadbusclientmodule.vala

index af5565ec3ec227e14ccdddff0b367126e8c8f77c..30f82c554fed3010c73a9faaca9d524b93bd2544 100644 (file)
@@ -1641,6 +1641,12 @@ internal class Vala.DBusClientModule : DBusModule {
 
                string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
 
+               var owned_type = prop.get_accessor.value_type.copy ();
+               owned_type.value_owned = true;
+               if (owned_type.is_disposable () && !prop.get_accessor.value_type.value_owned) {
+                       Report.error (prop.get_accessor.value_type.source_reference, "Properties used in D-Bus clients require owned get accessor");
+               }
+
                var array_type = prop.get_accessor.value_type as ArrayType;
 
                CCodeDeclaration cdecl;