catch G_SIGNAL_RUN_FIRST with a return value.
authorTim Janik <timj@gtk.org>
Thu, 22 Mar 2001 13:42:42 +0000 (13:42 +0000)
committerTim Janik <timj@src.gnome.org>
Thu, 22 Mar 2001 13:42:42 +0000 (13:42 +0000)
Thu Mar 22 13:36:50 2001  Tim Janik  <timj@gtk.org>

        * gsignal.c (g_signal_newv): catch G_SIGNAL_RUN_FIRST with a return value.

gobject/ChangeLog
gobject/gsignal.c

index 37487b7..d59e807 100644 (file)
@@ -1,3 +1,7 @@
+Thu Mar 22 13:36:50 2001  Tim Janik  <timj@gtk.org>
+
+       * gsignal.c (g_signal_newv): catch G_SIGNAL_RUN_FIRST with a return value.
+
 2001-03-21  Martin Baulig  <baulig@suse.de>
 
        * gboxed.[ch] (g_value_dup_boxed): This takes a `const GValue *'
index c518321..c78563d 100644 (file)
@@ -1109,6 +1109,16 @@ g_signal_newv (const gchar       *signal_name,
       G_UNLOCK (g_signal_mutex);
       return 0;
     }
+  if (return_type != G_TYPE_NONE &&
+      (signal_flags & (G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST | G_SIGNAL_RUN_CLEANUP)) == G_SIGNAL_RUN_FIRST)
+    {
+      g_warning (G_STRLOC ": signal \"%s::%s\" has return type `%s' and is only G_SIGNAL_RUN_FIRST",
+                g_type_name (itype), name,
+                g_type_name (return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE));
+      g_free (name);
+      G_UNLOCK (g_signal_mutex);
+      return 0;
+    }
   
   /* setup permanent portion of signal node */
   if (!node)