vala r2408 - in trunk: . gobject
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2408 - in trunk: . gobject
- Date: Thu, 29 Jan 2009 19:35:46 +0000 (UTC)
Author: pvanhoof
Date: Thu Jan 29 19:35:46 2009
New Revision: 2408
URL: http://svn.gnome.org/viewvc/vala?rev=2408&view=rev
Log:
2009-01-29 Philip Van Hoof <philip codeminded be>
* gobject/valaccodebasemodule.vala:
Checking for vstore in vala_dbus_register_object. Fixes a crash when
you use conn.register_object with an instance that isn't a DBus one
Modified:
trunk/ChangeLog
trunk/gobject/valaccodebasemodule.vala
Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala (original)
+++ trunk/gobject/valaccodebasemodule.vala Thu Jan 29 19:35:46 2009
@@ -452,7 +452,18 @@
cregister.add_argument (new CCodeIdentifier ("connection"));
cregister.add_argument (new CCodeIdentifier ("path"));
cregister.add_argument (new CCodeIdentifier ("object"));
- block.add_statement (new CCodeExpressionStatement (cregister));
+
+ var ifblock = new CCodeBlock ();
+ ifblock.add_statement (new CCodeExpressionStatement (cregister));
+
+ var elseblock = new CCodeBlock ();
+
+ var warn = new CCodeFunctionCall (new CCodeIdentifier ("g_warning"));
+ warn.add_argument (new CCodeConstant ("\"Object does not implement any D-Bus interface\""));
+
+ elseblock.add_statement (new CCodeExpressionStatement(warn));
+
+ block.add_statement (new CCodeIfStatement (new CCodeIdentifier ("vtable"), ifblock, elseblock));
source_type_member_definition.append (cfunc);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]