mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-09 07:08:10 +02:00
ppd-action-trickle-charge: Use autopointer for devices list
This commit is contained in:
parent
aeff8be3aa
commit
52cd7453eb
1 changed files with 2 additions and 4 deletions
|
|
@ -50,13 +50,13 @@ static void
|
|||
set_charge_type (PpdActionTrickleCharge *action,
|
||||
const char *charge_type)
|
||||
{
|
||||
GList *devices, *l;
|
||||
g_autolist (GUdevDevice) devices = NULL;
|
||||
|
||||
devices = g_udev_client_query_by_subsystem (action->client, "power_supply");
|
||||
if (devices == NULL)
|
||||
return;
|
||||
|
||||
for (l = devices; l != NULL; l = l->next) {
|
||||
for (GList *l = devices; l != NULL; l = l->next) {
|
||||
GUdevDevice *dev = l->data;
|
||||
const char *value;
|
||||
|
||||
|
|
@ -80,8 +80,6 @@ set_charge_type (PpdActionTrickleCharge *action,
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
g_list_free_full (devices, g_object_unref);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue