[gnome-bluetooth] lib: Fix possible crash when UPower updates
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: Fix possible crash when UPower updates
- Date: Wed, 16 Feb 2022 11:41:28 +0000 (UTC)
commit bad63cd298cea19344dc34d4dcc02167eede10d6
Author: Jonas Dreßler <verdre v0yd nl>
Date: Tue Feb 15 13:29:19 2022 +0100
lib: Fix possible crash when UPower updates
Due to a reference leak, libupower-glib could still callback into our
BluetoothClient even if it was already finalized as the signal handlers
were not forcibly disconnected when the BluetoothClient was.
See https://gitlab.freedesktop.org/upower/upower/-/merge_requests/112
Fixes: 983838f1
lib/bluetooth-client.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index b5de998f..54ecc40d 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -1000,10 +1000,10 @@ up_client_new_cb (GObject *source_object,
g_debug ("Successfully created UpClient");
client = user_data;
client->up_client = up_client;
- g_signal_connect (G_OBJECT (up_client), "device-added",
- G_CALLBACK (up_device_added_cb), client);
- g_signal_connect (G_OBJECT (up_client), "device-removed",
- G_CALLBACK (up_device_removed_cb), client);
+ g_signal_connect_object (G_OBJECT (up_client), "device-added",
+ G_CALLBACK (up_device_added_cb), client, 0);
+ g_signal_connect_object (G_OBJECT (up_client), "device-removed",
+ G_CALLBACK (up_device_removed_cb), client, 0);
up_client_get_devices_async (up_client, client->cancellable,
up_client_get_devices_cb, client);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]