[vala] D-Bus: Require class prerequisite for dbus interfaces
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] D-Bus: Require class prerequisite for dbus interfaces
- Date: Thu, 2 Jun 2011 18:09:59 +0000 (UTC)
commit 2c9bb02e005856dd580ad59250a6fce53b072d4c
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Jun 2 20:08:24 2011 +0200
D-Bus: Require class prerequisite for dbus interfaces
Fixes bug 651715.
codegen/valagdbusservermodule.vala | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala
index 8c1507d..6593d08 100644
--- a/codegen/valagdbusservermodule.vala
+++ b/codegen/valagdbusservermodule.vala
@@ -1225,7 +1225,13 @@ public class Vala.GDBusServerModule : GDBusClientModule {
alloc_data.add_argument (new CCodeConstant ("3"));
ccode.add_assignment (new CCodeIdentifier ("data"), alloc_data);
- var ref_object = new CCodeFunctionCall (new CCodeIdentifier (sym.get_ref_function ()));
+ var ref_function = sym.get_ref_function ();
+ if (sym is Interface && ref_function == null) {
+ Report.error (sym.source_reference, "missing class prerequisite for interface `%s', add GLib.Object to interface declaration if unsure".printf (sym.get_full_name ()));
+ return;
+ }
+
+ var ref_object = new CCodeFunctionCall (new CCodeIdentifier (ref_function));
ref_object.add_argument (new CCodeIdentifier ("object"));
ccode.add_assignment (new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0")), ref_object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]