From fe1215c74d731a2b6451f6ccbfd726a634003d5a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Oct 2014 17:36:59 +0200 Subject: [PATCH] Clean up selection model properly in completion. http://qt-project.org/doc/qt-5/qabstractitemview.html#setModel : This function will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required. --- qutebrowser/widgets/completion.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/widgets/completion.py b/qutebrowser/widgets/completion.py index 733f082bb..61576d734 100644 --- a/qutebrowser/widgets/completion.py +++ b/qutebrowser/widgets/completion.py @@ -190,7 +190,10 @@ class CompletionView(QTreeView): Args: model: The model to use. """ + sel_model = self.selectionModel() self.setModel(model) + if sel_model is not None: + sel_model.deleteLater() self.expandAll() self._resize_columns() model.rowsRemoved.connect(self.maybe_resize_completion)