Re: [gnome-db] GdaColumn and GdaColumnIndex



2005/10/5, Bas Driessen <bas driessen xobas com>:
>  Hello,
>
>  Still having a strange problem. Hope someone can help advise.
>
>  This works:
>
>  int main(int argc, char **argv)
>  {
>     gda_init("test", "1.0", argc, argv);
>     GdaColumn *abc = gda_column_new();
>     g_object_unref(abc);
>  }
>
>  This does not work:
>
>  int main(int argc, char **argv)
>  {
>     gda_init("test", "1.0", argc, argv);
>     GdaColumnIndex *abc = gda_column_index_new();
>     g_object_unref(abc);
>  }
>
>  This generates the warning: GLib-GObject-CRITICAL **: g_type_free_instance:
> assertion `instance != NULL && instance->g_class != NULL' failed
>
>  Both "new" functions only call g_object_new in libgda. My understanding is
> that I should use g_object_unref to free the mem (rather than g_free).

Yes, never call g_free() on an object!

>
>  When comparing the GdaColumn and GdaColumnIndex implementations in libgda,
> the only structural difference I can see is that the GdaColumnIndex does not
> have any signals. Anyway, after putting a signal in place it still fails.
>
>  Am I overlooking something simple, or is there an issue here?

There is a bug in the gda_column_index_finalize() function: there is a
g_free() there wich does it all... If you remove that line, then I'll
be fine.

Here is the patch attached (which also corrects another potention
problem). I'll commit the patch to CVS tonight.

Cheers,

Vivien

Attachment: PATCH_gda_column_index
Description: Binary data



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