From 8ccdf1d1548d50afafd21a285c4d0a430e0c1619 Mon Sep 17 00:00:00 2001 From: Sander Sweers Date: Sat, 6 Jul 2019 10:01:36 +0200 Subject: [PATCH] DeviceList: Remove Gtk.TreeIter from device_remove_event For some reason the iter goes invalid and we end up with below critical. This happens calling clear() and try to compare the iter to the selected. (blueman-manager:11183): Gtk-CRITICAL **: 09:48:11.834: gtk_list_store_get_path: assertion 'iter->stamp == priv->stamp' failed --- blueman/gui/DeviceList.py | 9 ++++----- blueman/gui/manager/ManagerDeviceList.py | 6 ++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/blueman/gui/DeviceList.py b/blueman/gui/DeviceList.py index 1e5b90377..450a504ce 100644 --- a/blueman/gui/DeviceList.py +++ b/blueman/gui/DeviceList.py @@ -119,7 +119,7 @@ def __on_manager_signal(self, manager, path, signal_name): row = self.get(tree_iter, "device") dev = row["device"] - self.device_remove_event(dev, tree_iter) + self.device_remove_event(dev) def on_selection_changed(self, selection): _model, tree_iter = selection.get_selected() @@ -216,10 +216,9 @@ def row_update_event(self, tree_iter, key, value): def device_add_event(self, device): self.add_device(device) - def device_remove_event(self, device, tree_iter): + def device_remove_event(self, device): logging.debug(device) - if tree_iter is None: - tree_iter = self.find_device(device) + tree_iter = self.find_device(device) if self.compare(self.selected(), tree_iter): self.emit("device-selected", None, None) @@ -337,7 +336,7 @@ def clear(self): for i in self.liststore: tree_iter = i.iter device = self.get(tree_iter, "device")["device"] - self.device_remove_event(device, tree_iter) + self.device_remove_event(device) self.liststore.clear() self.emit("device-selected", None, None) diff --git a/blueman/gui/manager/ManagerDeviceList.py b/blueman/gui/manager/ManagerDeviceList.py index 69f6b06c0..1dc75500e 100644 --- a/blueman/gui/manager/ManagerDeviceList.py +++ b/blueman/gui/manager/ManagerDeviceList.py @@ -202,7 +202,9 @@ def make_device_icon(self, icon_info, is_paired=False, is_trusted=False): return target - def device_remove_event(self, device, tree_iter): + def device_remove_event(self, device): + tree_iter = self.find_device(device) + row_fader = self.get(tree_iter, "row_fader")["row_fader"] row_fader.connect("animation-finished", self.__on_fader_finished, device, tree_iter) row_fader.thaw() @@ -212,7 +214,7 @@ def device_remove_event(self, device, tree_iter): def __on_fader_finished(self, fader, device, tree_iter): fader.disconnect_by_func(self.__on_fader_finished) fader.freeze() - super().device_remove_event(device, tree_iter) + super().device_remove_event(device) def device_add_event(self, device): self.add_device(device)