diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-10-04 20:20:05 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-10-04 20:20:05 +0000 |
commit | ca4e2341135a8212ba45f2b3091f6f3cd9302b24 (patch) | |
tree | 5335775d79cdfd0c9eb4e27488c3bd5c9ecd4b16 /gobject | |
parent | 8dc560a73999290b557893cf3d3eb1687983e021 (diff) |
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)
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/ChangeLog | 5 | ||||
-rw-r--r-- | gobject/gsignal.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 241e42c37..36d154875 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -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 diff --git a/gobject/gsignal.c b/gobject/gsignal.c index 9aa2dc358..aa24dd9c8 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -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); |