g_type_init() and opensync

View: New views
4 Messages — Rating Filter:   Alert me  

g_type_init() and opensync

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

According to
http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html
g_type_init() must be called before any part of the gtype or gobject system
is used.

A grep through the opensync and osynctool sources reveals that this function
is never called.

Any thoughts on where to put this call?  Is this handled somewhere else
that I don't see?  I hope this only has to be called once inside opensync,
and maybe once inside osengine?

Thanks,
- Chris


------------------------------------------------------------------------------
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: g_type_init() and opensync

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Apr 02, 2009 at 08:42:07PM -0400, Chris Frey wrote:
> Hi,
>
> According to
> http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html
> g_type_init() must be called before any part of the gtype or gobject system
> is used.

Nevermind... I'm trying to track down some glib assert messages,
and I thought the above was important.  Looks like g_type_init() is not
exposed by the glib library, but the gobject library, so there's no way
for opensync to call it.

The asserts I'm tracking are likely coming from the evolution plugin,
which links to libgobject.

- Chris


------------------------------------------------------------------------------
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: g_type_init() and opensync

by Daniel Gollub-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 03 April 2009 02:42:07 am Chris Frey wrote:
> Hi,
>
> According to
> http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.ht
>ml g_type_init() must be called before any part of the gtype or gobject
> system is used.
>
> A grep through the opensync and osynctool sources reveals that this
> function is never called.

I thought and i hope that we don't use any gobject or gtype interfaces from
glib. At least a quick grep didn't showed me any. Please correct me if i'm
wrong. (AFAIK libsyncml is using them...)

Best Regards,
Daniel

------------------------------------------------------------------------------
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

[patch rfc] Re: g_type_init() and opensync

by Chris Frey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Apr 03, 2009 at 03:10:20AM +0200, Daniel Gollub wrote:
> I thought and i hope that we don't use any gobject or gtype interfaces from
> glib. At least a quick grep didn't showed me any. Please correct me if i'm
> wrong. (AFAIK libsyncml is using them...)

Yes, you're right.  The gobject issues I was tracking ended up in the
evolution plugin.

When I apply this patch to my version, things are a whole lot more stable.
Even without my previous HANDLE_LIBICAL_MEMORY that Patrick Ohly
commented on.  Hopefully this is the "real" fix I've been chasing all along.
:-)

Comments welcome.
- Chris


diff --git a/src/evolution2_sync.c b/src/evolution2_sync.c
index 93a1685..6cd7a93 100644
--- a/src/evolution2_sync.c
+++ b/src/evolution2_sync.c
@@ -206,6 +206,8 @@ static osync_bool evo2_discover(OSyncPluginInfo *info, void *data, OSyncError **
 
 osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error)
 {
+ g_type_init();
+
  OSyncPlugin *plugin = osync_plugin_new(error);
  if (!plugin)
  goto error;


------------------------------------------------------------------------------
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel