gsignal: Warn if g_signal_lookup() is called on an invalid signal name

And add a test for it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall
2019-11-12 21:15:13 +00:00
parent 463a75c11e
commit c577bc89cd
2 changed files with 28 additions and 0 deletions

View File

@@ -1331,6 +1331,9 @@ g_signal_lookup (const gchar *name,
else if (!g_type_class_peek (itype))
g_warning (G_STRLOC ": unable to look up signal \"%s\" of unloaded type '%s'",
name, g_type_name (itype));
else if (!is_valid_signal_name (name))
g_warning (G_STRLOC ": unable to look up invalid signal name \"%s\" on type '%s'",
name, g_type_name (itype));
}
return signal_id;