mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-05-06 14:58:10 +02:00
device: Unwatch names when removing them
If a device is unplugged/destroyed while a client is using it, then we would still end up watching the name. The vanish notification will then access the destroyed FprintDevice object. Fix this by unwatching the bus name when removing the client entry from the dictionary.
This commit is contained in:
parent
8ed77829a7
commit
83cd09ba2f
1 changed files with 6 additions and 1 deletions
|
|
@ -305,6 +305,11 @@ static void fprint_device_class_init(FprintDeviceClass *klass)
|
|||
quark_auth_user = g_quark_from_static_string ("authorized-user");
|
||||
}
|
||||
|
||||
static void _unwatch_name (gpointer id)
|
||||
{
|
||||
g_bus_unwatch_name (GPOINTER_TO_INT (id));
|
||||
}
|
||||
|
||||
static void fprint_device_init(FprintDevice *device)
|
||||
{
|
||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(device);
|
||||
|
|
@ -315,7 +320,7 @@ static void fprint_device_init(FprintDevice *device)
|
|||
priv->clients = g_hash_table_new_full (g_str_hash,
|
||||
g_str_equal,
|
||||
g_free,
|
||||
NULL);
|
||||
_unwatch_name);
|
||||
|
||||
g_signal_connect (device, "g-authorize-method",
|
||||
G_CALLBACK (action_authorization_handler),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue