Skip to content

Commit

Permalink
... gc
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Mar 8, 2024
1 parent 32cfbff commit 193061c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Orange/widgets/data/utils/pythoneditor/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def iterateBlocksBackFrom(block):
def clear_extra_selections(selections: List[QTextEdit.ExtraSelection]):
for s in selections:
s.cursor = QTextCursor()
s.format = QTextCharFormat()


class PythonEditor(QPlainTextEdit):
Expand Down Expand Up @@ -981,6 +982,8 @@ def terminate(self):

if self._vim is not None:
self._vim.terminate()
clear_extra_selections(self._userExtraSelections)
self._userExtraSelections.clear()

def __enter__(self):
"""Context management method.
Expand Down
3 changes: 2 additions & 1 deletion Orange/widgets/data/utils/pythoneditor/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def setUp(self) -> None:

def tearDown(self) -> None:
self.qpart.terminate()
gc.collect()
delete(self.qpart)
del self.qpart
gc.collect()
# gc.collect()
super().tearDown()


Expand Down

0 comments on commit 193061c

Please sign in to comment.