diff options
author | Ross Burton <ross@linux.intel.com> | 2009-03-11 11:48:22 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-04-07 19:30:40 +0100 |
commit | ec82339984d5d61774ab4a905f60b43abeb53583 (patch) | |
tree | 4dfe1511240ffba7a149bdaa9893ce170bb02430 /tools/glib-ginterface-gen.py | |
parent | 8e42c802215f5f42e7eaea19b36ee37912eb7b51 (diff) | |
download | telepathy-glib-ec82339984d5d61774ab4a905f60b43abeb53583.tar.gz |
Install the type infomation earlier
If the type information is installed last then it is possible for dbus-glib to
assert because the dbus-glib containers haven't been initialized yet. This is
done by installing type info, getting a bus connection, or registering an
object, which isn't always done before object construction.
[Patch modified to install the information just after variable
declarations, rather than before as in Ross's original patch, in order
to be valid C89.]
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'tools/glib-ginterface-gen.py')
-rw-r--r-- | tools/glib-ginterface-gen.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py index 3e4195e54..f42a85ff7 100644 --- a/tools/glib-ginterface-gen.py +++ b/tools/glib-ginterface-gen.py @@ -232,6 +232,15 @@ class Generator(object): self.b(' static TpDBusPropertiesMixinIfaceInfo interface =') self.b(' { 0, properties, NULL, NULL };') self.b('') + + + self.b(' dbus_g_object_type_install_info (%s%s_get_type (),' + % (self.prefix_, node_name_lc)) + self.b(' &_%s%s_object_info);' + % (self.prefix_, node_name_lc)) + self.b('') + + if properties: self.b(' interface.dbus_interface = g_quark_from_static_string ' '("%s");' % self.iface_name) @@ -248,10 +257,6 @@ class Generator(object): for s in base_init_code: self.b(s) - self.b(' dbus_g_object_type_install_info (%s%s_get_type (),' - % (self.prefix_, node_name_lc)) - self.b(' &_%s%s_object_info);' - % (self.prefix_, node_name_lc)) self.b('}') self.b('static void') |