GNOME Bugzilla – Bug 791727
bluetooth-client: Remove all devices on adapter removal
Last modified: 2018-02-20 11:43:57 UTC
Fixes a corner case when bluetoothd crashes.
Created attachment 365680 [details] [review] bluetooth-client: Remove all devices on adapter removal If bluetoothd fails badly (e.g. kill -9), then the devices may not be removed before the adapter is removed. So clean up any left over device at adapter removal as otherwise the "device-removed" is not fired. Without this one ends up with stale entries in the bluetooth settings widget after killing bluetoothd.
Review of attachment 365680 [details] [review]: > Remove all devices on adapter removal Please put the user-facing effect of the fix here (the description you have in the bug), rather than what the code is doing (which you already explain in the commit message). Looks good after those changes. ::: lib/bluetooth-client.c @@ +650,3 @@ + /* Ensure that all devices are removed. This can happen if bluetoothd + * crashes and does not unregister the objects. */ > and does not unregister the objects. I'd rather: "and ObjectManager doesn't send "object-removed" signals for children." @@ +655,3 @@ + GDBusProxy *object; + + gtk_tree_model_get(GTK_TREE_MODEL(priv->store), &childiter, Space before "(" @@ +660,3 @@ + g_signal_emit (G_OBJECT (client), signals[DEVICE_REMOVED], 0, g_dbus_proxy_get_object_path (object)); + have_child = gtk_tree_store_remove (priv->store, &childiter); + g_object_unref (object); unref() the object one line above, after its last use, and a linefeed before have_child =...
Pushed to master and gnome-3-26 with a more elaborate explanation.