mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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:
commit
f3f23b0229
@ -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)
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user