How to Find Out Where Is My Code Causing Glib-Gobject-Critical

How can I find out where is my code causing GLib-GObject-CRITICAL?

You can break on g_log and then do a backtrace from there.

GLib-GObject-CRITICAL warnings

I found the problem.

This code was ported from an original implementation in C, and I had a requirement before to use an array of function pointers to call the functions inside of a shared library. Although this [seemed] to work at the time once I actually started using them it was not the case. I am a little stumped on why its not working, but I was able to centralized the problem to the following piece of code.


gtk_signal_connect (GTK_OBJECT (plugin()->workbook()->gtk_workbook), "switch-page",
(GtkSignalFunc)this->signals[NOTEBOOK_SWITCHPAGE], plugin->workbook());

Was changed to the following:


gtk_signal_connect (GTK_OBJECT (plugin()->workbook()->gtk_workbook), "switch-page",
(GtkSignalFunc)signal_gtknotebook_switchpage, plugin->workbook());

Now, the code compiles and I am not getting any nasty errors. I think this is the answer!

How do I get GDB to break on a GLib assertion failure?

Break on g_log(). This covers all cases like g_warning(), g_critical(), etc.



Related Topics



Leave a reply



Submit