mirror of
https://github.com/brl/mutter.git
synced 2024-12-02 04:40:43 -05:00
tests/meta-context-test: Free D-Bus call results
Don't leak the resulting `GVariant`. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2817>
This commit is contained in:
parent
678bc69e72
commit
1a814250c0
@ -64,6 +64,7 @@ add_colord_system_profile (const char *cd_profile_id,
|
|||||||
GDBusProxy *proxy;
|
GDBusProxy *proxy;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
GVariantBuilder params_builder;
|
GVariantBuilder params_builder;
|
||||||
|
g_autoptr (GVariant) ret = NULL;
|
||||||
|
|
||||||
proxy = get_colord_mock_proxy ();
|
proxy = get_colord_mock_proxy ();
|
||||||
|
|
||||||
@ -71,11 +72,12 @@ add_colord_system_profile (const char *cd_profile_id,
|
|||||||
g_variant_builder_add (¶ms_builder, "s", cd_profile_id);
|
g_variant_builder_add (¶ms_builder, "s", cd_profile_id);
|
||||||
g_variant_builder_add (¶ms_builder, "s", file_path);
|
g_variant_builder_add (¶ms_builder, "s", file_path);
|
||||||
|
|
||||||
if (!g_dbus_proxy_call_sync (proxy,
|
ret = g_dbus_proxy_call_sync (proxy,
|
||||||
"AddSystemProfile",
|
"AddSystemProfile",
|
||||||
g_variant_builder_end (¶ms_builder),
|
g_variant_builder_end (¶ms_builder),
|
||||||
G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, NULL,
|
G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, NULL,
|
||||||
&error))
|
&error);
|
||||||
|
if (ret == NULL)
|
||||||
g_error ("Failed to add system profile: %s", error->message);
|
g_error ("Failed to add system profile: %s", error->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,10 +390,11 @@ meta_context_test_init (MetaContextTest *context_test)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_dbus_proxy_call_sync (proxy,
|
ret = g_dbus_proxy_call_sync (proxy,
|
||||||
"Reset",
|
"Reset",
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, NULL,
|
G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, NULL,
|
||||||
&error))
|
&error);
|
||||||
|
if (ret == NULL)
|
||||||
g_warning ("Failed to clear mocked color devices: %s", error->message);
|
g_warning ("Failed to clear mocked color devices: %s", error->message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user