Re: g_signal_list_ids() always returns 0 signals

Sven Neumann wrote:


I've noticed that the docs generated by gtk-doc on my system differ
from what is checked into CVS and tried to track down why this happens.
I found that the <project>.signals file generated from gtkdoc-scangobj
is always empty. A little investigation later I came to the conclusion
that this happens because g_signal_list_ids() seems to always return an empty array and sets n_signals to 0 as if no signals were registered
at all. I've put some debugging code

    guint *signals, n_signals;

    signals = g_signal_list_ids (G_TYPE_FROM_INSTANCE (object), &n_signals);
    g_print ("%d signals\n", n_signals, signals);

into the instance_init() functions of some objects that register a number
of signals in their class_init() functions and yes, the output is always

  0 signals

Maybe something went wrong with the latest changes to GBSearchArray?

Surround the list_ids() call with g_type_class_ref and g_type_class_unref calls, in order to make sure the class_init() function for the class has been called.

Calling the get_type() routine doesn't guarantee that the type's class struct has been initialised. You need to ref the class to make sure the signals/properties have been registered.


Email: james daa com au

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