> GError *err = NULL;
> > if (!gtk_builder_add_from_file(builder_, "myfile.xml", &err)) {
> >    if (err) {
> >       g_free(err); // commenting this solves the crash but other gtk apis
>
> I don't know gtkmm, but at least in C GErrors are freed with
> g_error_free(err).
>

You are obviously right. I always used g_free() to free errors, my fault.
I've grepped tons of sources and I had everywhere the code bugged, then I
googled around to search some more examples and I've found there are a lot
of other sources in the net where a GError is freed with g_free, I think
improving the documentation of the functions that use a GError as input
parameter may help programmers do not write wrong code in this situation.

-- 
Bye,
 Gabry
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to