flash: Fix GVariant leaks
All functions used there are transfer: full but only two of them were freed.
This commit is contained in:
@@ -140,22 +140,20 @@ static void
|
|||||||
brightness_received(GDBusProxy *proxy, GAsyncResult *res, gpointer user_data)
|
brightness_received(GDBusProxy *proxy, GAsyncResult *res, gpointer user_data)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
GVariant *result = g_dbus_proxy_call_finish(proxy, res, &error);
|
g_autoptr(GVariant) result = g_dbus_proxy_call_finish(proxy, res, &error);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
printf("Failed to get display brightness: %s\n", error->message);
|
printf("Failed to get display brightness: %s\n", error->message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GVariant *values = g_variant_get_child_value(result, 0);
|
g_autoptr(GVariant) values = g_variant_get_child_value(result, 0);
|
||||||
if (g_variant_n_children(values) == 0) {
|
if (g_variant_n_children(values) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GVariant *brightness = g_variant_get_child_value(values, 0);
|
g_autoptr(GVariant) brightness = g_variant_get_child_value(values, 0);
|
||||||
dbus_old_brightness = g_variant_get_int32(brightness);
|
dbus_old_brightness = g_variant_get_int32(brightness);
|
||||||
|
|
||||||
g_variant_unref(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
Reference in New Issue
Block a user