vala r1128 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1128 - in trunk: . gobject
- Date: Sat, 15 Mar 2008 20:16:39 +0000 (GMT)
Author: juergbi
Date: Sat Mar 15 20:16:39 2008
New Revision: 1128
URL: http://svn.gnome.org/viewvc/vala?rev=1128&view=rev
Log:
2008-03-15 Juerg Billeter <j bitron ch>
* gobject/valaccodegeneratorinvocationexpression.vala: fix crash
when using arrays for D-Bus method calls
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegeneratorinvocationexpression.vala
Modified: trunk/gobject/valaccodegeneratorinvocationexpression.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorinvocationexpression.vala (original)
+++ trunk/gobject/valaccodegeneratorinvocationexpression.vala Sat Mar 15 20:16:39 2008
@@ -503,9 +503,10 @@
ccomma.append_expression (cndupcall);
expr.ccodenode = ccomma;
- } else if (m is DBusMethod && m.return_type.data_type != null) {
+ } else if (m is DBusMethod && !(m.return_type is VoidType)) {
// synchronous D-Bus method call with reply
if (m.return_type is ArrayType && ((ArrayType) m.return_type).element_type.data_type != string_type.data_type) {
+ // non-string arrays (use GArray)
var array_type = (ArrayType) m.return_type;
ccall.add_argument (get_dbus_array_type (array_type));
@@ -527,8 +528,16 @@
} else {
expr.append_array_size (new CCodeConstant ("-1"));
}
- } else {
- ccall.add_argument (new CCodeIdentifier (m.return_type.data_type.get_type_id ()));
+ } else if (m.return_type is ArrayType || m.return_type.data_type != null) {
+ // string arrays or other datatypes
+
+ if (m.return_type is ArrayType) {
+ // string arrays
+ ccall.add_argument (new CCodeIdentifier ("G_TYPE_STRV"));
+ } else {
+ // other types
+ ccall.add_argument (new CCodeIdentifier (m.return_type.data_type.get_type_id ()));
+ }
var temp_decl = get_temp_variable_declarator (m.return_type);
temp_vars.insert (0, temp_decl);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]