Skip to content

Commit

Permalink
Merge pull request #2961 from ales-erjavec/fixes/owfile-memleak
Browse files Browse the repository at this point in the history
[FIX] domaineditor: Give the VarTableModel a parent
  • Loading branch information
lanzagar authored Mar 30, 2018
2 parents 8d9ce7e + 3491ce5 commit 17c385f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Orange/widgets/utils/domaineditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class VarTableModel(QAbstractTableModel):
name2type = dict(zip(typenames, vartypes))
type2name = dict(zip(vartypes, typenames))

def __init__(self, variables):
super().__init__()
def __init__(self, variables, *args):
super().__init__(*args)
self.variables = variables

def set_variables(self, variables):
Expand Down Expand Up @@ -186,7 +186,8 @@ def __init__(self, widget):
widget.contextOpened.connect(lambda: self.model().set_variables(self.variables))
widget.contextClosed.connect(lambda: self.model().set_variables([]))

self.setModel(VarTableModel(self.variables))
self.setModel(VarTableModel(self.variables, self))

self.setSelectionMode(QTableView.NoSelection)
self.horizontalHeader().setStretchLastSection(True)
self.setShowGrid(False)
Expand Down

0 comments on commit 17c385f

Please sign in to comment.