Merge branch 'gsignalgroup-avoid-g-return-macro' into 'main'

gsignalgroup: Avoid function call with side effect in g_return_* macro

See merge request GNOME/glib!3678
This commit is contained in:
Philip Withnall 2023-11-01 10:53:55 +00:00
commit f3f23b0229
2 changed files with 8 additions and 3 deletions

View File

@ -717,10 +717,15 @@ g_signal_group_connect_closure_ (GSignalGroup *self,
g_return_val_if_fail (G_IS_SIGNAL_GROUP (self), FALSE);
g_return_val_if_fail (detailed_signal != NULL, FALSE);
g_return_val_if_fail (g_signal_parse_name (detailed_signal, self->target_type,
&signal_id, &signal_detail, TRUE) != 0, FALSE);
g_return_val_if_fail (closure != NULL, FALSE);
if (!g_signal_parse_name (detailed_signal, self->target_type,
&signal_id, &signal_detail, TRUE))
{
g_critical ("Invalid signal name “%s”", detailed_signal);
return FALSE;
}
g_rec_mutex_lock (&self->mutex);
if (self->has_bound_at_least_once)

View File

@ -305,7 +305,7 @@ test_signal_group_invalid (void)
/* Invalid Signal Name */
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
"*g_signal_parse_name*");
"*Invalid signal name “does-not-exist”*");
group = g_signal_group_new (signal_target_get_type ());
g_signal_group_connect (group,
"does-not-exist",