[gnome-bluetooth] lib: Fix crash when adapter/device store is destroyed
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: Fix crash when adapter/device store is destroyed
- Date: Wed, 22 Nov 2017 17:57:05 +0000 (UTC)
commit c475fa2888bdcc7a4cf1c877510ba3055ed3c6c5
Author: Benjamin Berg <bberg redhat com>
Date: Wed Nov 22 15:38:44 2017 +0100
lib: Fix crash when adapter/device store is destroyed
Patch 17983ace (lib: Use GDBusObjectManager) changes the logic of
device_add and adapter_add so that the device/adapter object is passsed
in. Because of that the object must not be unref'ed anymore, as it is
owned by the surrounding code (i.e. GDBusObjectManager).
https://bugzilla.gnome.org/show_bug.cgi?id=790714
lib/bluetooth-client.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 7d0f272..65f2950 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -449,10 +449,8 @@ device_added (GDBusObjectManager *manager,
uuids = device_list_uuids (device1_get_uuids (device));
legacypairing = device1_get_legacy_pairing (device);
- if (get_iter_from_path (priv->store, &parent, adapter_path) == FALSE) {
- g_object_unref (device);
+ if (get_iter_from_path (priv->store, &parent, adapter_path) == FALSE)
return;
- }
gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &parent,
BLUETOOTH_COLUMN_PROXY, &adapter, -1);
@@ -687,8 +685,6 @@ adapter_added (GDBusObjectManager *manager,
g_dbus_object_get_object_path (g_dbus_interface_get_object
(G_DBUS_INTERFACE (adapter))),
client);
}
-
- g_object_unref (adapter);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]