summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2008-12-08 13:50:35 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2008-12-08 13:50:35 -0200
commit5f5a0baa91d60c66d5d2e38e492df786c933fc72 (patch)
tree3fe9505eb18fbc5e89b01a433c0f957ba6f6a349
parentb32d30907623f3a9eb26204776a67d50a88c163c (diff)
downloadtuna-5f5a0baa91d60c66d5d2e38e492df786c933fc72.tar.gz
gui: procview: update_rows should do a paranoia check on dup rows
In procview the rows are used while checking if new threads appeared and if old ones died, but somehow with some pygtk2 releases we could end up with duplicates, i.e. a thread that already was in the list_store would be added again because the traversal of the existing rows wouldn't find it even with it being there. Add a workaround to remove the previous entry if it has the same pid. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tuna/tuna_gui.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py
index 6531710..1638fa0 100644
--- a/tuna/tuna_gui.py
+++ b/tuna/tuna_gui.py
@@ -1115,8 +1115,14 @@ class procview:
def update_rows(self, threads, row, parent_row):
new_tids = threads.keys()
+ previous_row = None
while row:
tid = self.tree_store.get_value(row, self.COL_PID)
+ if previous_row:
+ previous_tid = self.tree_store.get_value(previous_row, self.COL_PID)
+ if previous_tid == tid:
+ # print "WARNING: tree_store dup %d, fixing..." % tid
+ self.tree_store.remove(previous_row)
if not threads.has_key(tid):
if self.tree_store.remove(row):
# removed and now row is the next one
@@ -1150,6 +1156,7 @@ class procview:
child_row = self.tree_store.iter_children(row)
self.update_rows(children, child_row, row)
+ previous_row = row
row = self.tree_store.iter_next(row)
new_tids.sort()