[PATCH] Install the type infomation earlier

Ross Burton ross at linux.intel.com
Wed Mar 11 04:48:22 PDT 2009


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.
---
 tools/glib-ginterface-gen.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
index 3e4195e..51c9313 100644
--- a/tools/glib-ginterface-gen.py
+++ b/tools/glib-ginterface-gen.py
@@ -207,6 +207,10 @@ class Generator(object):
         self.b('%s%s_base_init_once (gpointer klass G_GNUC_UNUSED)'
                % (self.prefix_, node_name_lc))
         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))
 
         if properties:
             self.b('  static TpDBusPropertiesMixinPropInfo properties[%d] = {'
@@ -248,10 +252,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')
-- 
1.6.1.3


--=-6GkxsubVaK+R7HRpy4R9--



More information about the telepathy mailing list