John Bellone
John Bellone

Reputation: 1371

GLib-GObject-CRITICAL warnings

I'm confused by these two warnings. Can anyone explain how I might have come about triggering them, and how they would be able to be debugged in gdb?

(gtkworkbook:24668): GLib-GObject-CRITICAL **: g_cclosure_new: assertion `callback_func != NULL' failed

(gtkworkbook:24668): GLib-GObject-CRITICAL **: g_signal_connect_closure_by_id: assertion `closure != NULL' failed

Upvotes: 1

Views: 6320

Answers (2)

John Bellone
John Bellone

Reputation: 1371

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!

Upvotes: 1

mattwright
mattwright

Reputation: 788

One thing you can try is pass in --g-fatal-warnings to Gtk::Main, this will cause warnings to assert. You can attach with gdb and maybe figure out some more detail about where this is failing.

Upvotes: 3

Related Questions