mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-03 21:50:09 +01:00
daemon: Don't add unexported devices to the array
Otherwise all the following devices will be ignored.
This commit is contained in:
parent
f035ab12a5
commit
b624a690a2
1 changed files with 4 additions and 1 deletions
|
|
@ -438,8 +438,11 @@ up_daemon_enumerate_devices (UpExportedDaemon *skeleton,
|
|||
object_paths = g_ptr_array_new_with_free_func (g_free);
|
||||
array = up_device_list_get_array (daemon->priv->power_devices);
|
||||
for (i = 0; i < array->len; i++) {
|
||||
const char *object_path;
|
||||
device = (UpDevice *) g_ptr_array_index (array, i);
|
||||
g_ptr_array_add (object_paths, g_strdup (up_device_get_object_path (device)));
|
||||
object_path = up_device_get_object_path (device);
|
||||
if (object_path != NULL)
|
||||
g_ptr_array_add (object_paths, g_strdup (object_path));
|
||||
}
|
||||
g_ptr_array_unref (array);
|
||||
g_ptr_array_add (object_paths, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue