mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 16:58:07 +02:00
Fix a crash with the Linux backend
This commit is contained in:
parent
d42187ef5f
commit
ce955ea09f
2 changed files with 6 additions and 9 deletions
|
|
@ -917,7 +917,7 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
|
|||
"Is a laptop",
|
||||
"If this computer is probably a laptop",
|
||||
FALSE,
|
||||
G_PARAM_READABLE));
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_CAN_SUSPEND,
|
||||
|
|
@ -957,7 +957,7 @@ dkp_daemon_class_init (DkpDaemonClass *klass)
|
|||
"Laptop lid is closed",
|
||||
"If the laptop lid is closed",
|
||||
FALSE,
|
||||
G_PARAM_READABLE));
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
dbus_g_object_type_install_info (DKP_TYPE_DAEMON, &dbus_glib_dkp_daemon_object_info);
|
||||
|
||||
|
|
|
|||
|
|
@ -278,9 +278,13 @@ dkp_backend_coldplug (DkpBackend *backend, DkpDaemon *daemon)
|
|||
|
||||
backend->priv->daemon = g_object_ref (daemon);
|
||||
backend->priv->device_list = dkp_daemon_get_device_list (daemon);
|
||||
backend->priv->gudev_client = g_udev_client_new (subsystems);
|
||||
g_signal_connect (backend->priv->gudev_client, "uevent",
|
||||
G_CALLBACK (dkp_backend_uevent_signal_handler_cb), backend);
|
||||
|
||||
/* add all subsystems */
|
||||
for (i=0; subsystems[i] != NULL; i++) {
|
||||
egg_debug ("registering subsystem : %s", subsystems[i]);
|
||||
devices = g_udev_client_query_by_subsystem (backend->priv->gudev_client, subsystems[i]);
|
||||
for (l = devices; l != NULL; l = l->next) {
|
||||
native = l->data;
|
||||
|
|
@ -290,13 +294,6 @@ dkp_backend_coldplug (DkpBackend *backend, DkpDaemon *daemon)
|
|||
g_list_free (devices);
|
||||
}
|
||||
|
||||
/* connect to the DeviceKit backend */
|
||||
for (i=0; subsystems[i] != NULL; i++)
|
||||
egg_debug ("registering subsystem : %s", subsystems[i]);
|
||||
backend->priv->gudev_client = g_udev_client_new (subsystems);
|
||||
g_signal_connect (backend->priv->gudev_client, "uevent",
|
||||
G_CALLBACK (dkp_backend_uevent_signal_handler_cb), backend);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue