mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-01 19:36:37 +02:00
Merge branch 'gsettings_closure' into 'main'
Incorrect output parameter handling in closure helper of g_settings_bind_with_mapping_closures See merge request GNOME/glib!4667
This commit is contained in:
@@ -3161,6 +3161,14 @@ bind_with_mapping_invoke_get (GValue *value,
|
||||
g_closure_invoke (data->get_mapping_closure, &out, 2, params, /* hint = */ NULL);
|
||||
|
||||
retval = g_value_get_boolean (&out);
|
||||
if (retval)
|
||||
{
|
||||
const GValue *out_value = g_value_get_boxed (¶ms[0]);
|
||||
|
||||
g_assert (out_value != NULL);
|
||||
|
||||
g_value_copy (out_value, value);
|
||||
}
|
||||
|
||||
g_value_unset (&out);
|
||||
g_value_unset (¶ms[0]);
|
||||
|
@@ -1827,6 +1827,7 @@ test_bind_with_mapping_closures_parameters (void)
|
||||
GSettings *settings;
|
||||
GClosure *get;
|
||||
GClosure *set;
|
||||
gboolean val;
|
||||
BindWithMappingData data = { FALSE, FALSE, FALSE, FALSE };
|
||||
|
||||
settings = g_settings_new ("org.gtk.test.binding");
|
||||
@@ -1843,6 +1844,8 @@ test_bind_with_mapping_closures_parameters (void)
|
||||
|
||||
g_assert_true (data.get_called);
|
||||
g_assert_false (data.set_called);
|
||||
g_object_get (obj, "bool", &val, NULL);
|
||||
g_assert_true (val);
|
||||
|
||||
data.get_called = FALSE;
|
||||
g_object_set (obj, "bool", FALSE, NULL);
|
||||
|
Reference in New Issue
Block a user