[GTKUI] Fix gtk warning on shutdown

This commit is contained in:
bendikro 2016-01-20 16:17:26 +01:00 committed by Calum Lind
parent 7c1f39d10e
commit f3bfe177ce

View File

@ -427,9 +427,10 @@ class ListView:
# Store a copy of this columns state in case it's re-added
state = self.create_column_state(self.columns[header].column)
self.removed_columns_state.append(state)
# Start by removing this column from the treeview
self.treeview.remove_column(self.columns[header].column)
# Only remove column if column is associated with the treeview. This avoids
# warning on shutdown when GTKUI is closed before plugins try to remove columns
if self.columns[header].column.get_tree_view() is not None:
self.treeview.remove_column(self.columns[header].column)
# Get the column indices
column_indices = self.columns[header].column_indices
# Delete the column