Improve the warning if G_SIGNAL_NO_HOOKS is set. (#154299, Nickolay V.

2004-10-04  Matthias Clasen  <mclasen@redhat.com>

	* gsignal.c (g_signal_add_emission_hook): Improve the warning
	if G_SIGNAL_NO_HOOKS is set.  (#154299, Nickolay V. Shmyrev)
This commit is contained in:
Matthias Clasen 2004-10-04 20:20:05 +00:00 committed by Matthias Clasen
parent 8dc560a739
commit ca4e234113
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-10-04 Matthias Clasen <mclasen@redhat.com>
* gsignal.c (g_signal_add_emission_hook): Improve the warning
if G_SIGNAL_NO_HOOKS is set. (#154299, Nickolay V. Shmyrev)
2004-09-22 Tor Lillqvist <tml@iki.fi>
* Makefile.am (install-libtool-import-lib): [Win32] Add code to

View File

@ -825,12 +825,18 @@ g_signal_add_emission_hook (guint signal_id,
SIGNAL_LOCK ();
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || node->destroyed || (node->flags & G_SIGNAL_NO_HOOKS))
if (!node || node->destroyed)
{
g_warning ("%s: invalid signal id `%u'", G_STRLOC, signal_id);
SIGNAL_UNLOCK ();
return 0;
}
if (node->flags & G_SIGNAL_NO_HOOKS)
{
g_warning ("%s: signal id `%u' does not support emission hooks (G_SIGNAL_NO_HOOKS flag set)", G_STRLOC, signal_id);
SIGNAL_UNLOCK ();
return 0;
}
if (detail && !(node->flags & G_SIGNAL_DETAILED))
{
g_warning ("%s: signal id `%u' does not support detail (%u)", G_STRLOC, signal_id, detail);