Improve the warning if G_SIGNAL_NO_HOOKS is set. (#154299, Nickolay V.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 4 Oct 2004 20:20:05 +0000 (20:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 4 Oct 2004 20:20:05 +0000 (20:20 +0000)
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)

gobject/ChangeLog
gobject/gsignal.c

index 241e42c37012d5fedacf738f926b13d429158a04..36d154875c5913d5799a3c873f7a722df46c0665 100644 (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
index 9aa2dc358da80efebebb633e8d9e5876ef11d888..aa24dd9c8a708fe7f71ae253483f3ea0ab27ecfa 100644 (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);