Re: [Evolution-hackers] Error while trying to obtain ESource list



You were right again Peter!

Thanks :)

On 7/25/06, Peter Colijn <pcolijn gmail com> wrote:
Hi Teresa,

On 7/25/06, Teresa Thomas <tere ertw gmail com> wrote:
> (process:4289): GLib-GObject-CRITICAL **: gtype.c:2215: initialization
> assertion failed, use IA__g_type_init() prior to this function
>
> (process:4289): GLib-GObject-CRITICAL **: g_object_new: assertion
> `G_TYPE_IS_OBJECT (object_type)' failed
> Debug: After calling e_source_list_new()
>
> (process:4289): GLib-GObject-CRITICAL **: gtype.c:2215: initialization
> assertion failed, use IA__g_type_init() prior to this function
>
> (process:4289): GLib-GObject-CRITICAL **: g_object_new: assertion
> `G_TYPE_IS_OBJECT (object_type)' failed
> Segmentation fault

I think the issue here is that g_type_init() is not being called.
Generally for gnome programs, the first thing main() should do is call
gnome_program_init, which will call the init()s of a bunch of
libraries and make sure that everything is happy. I can get
e_source_list_new() to not complain with the following code:

#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-ui-init.h>
#include <libedataserver/e-source-list.h>

int main(int argc, char **argv) {
  GnomeProgram * app;
  app = gnome_program_init("esourcelist_test", "0.1",
                           LIBGNOMEUI_MODULE, argc, argv,
                           GNOME_PARAM_NONE);

  ESourceList *esourcelist = e_source_list_new();
  g_free(esourcelist);

  return 0;
}

Have fun,

Peter



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]