catch G_SIGNAL_RUN_FIRST with a return value.

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.
This commit is contained in:
Tim Janik 2001-03-22 13:42:42 +00:00 committed by Tim Janik
parent fb3a83820e
commit b7d54841ee
2 changed files with 14 additions and 0 deletions

View 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 *'

View 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)