Skip to content

Commit

Permalink
concurrent: Remove task.deleteLater calls
Browse files Browse the repository at this point in the history
Allow PyOwned to fully handle the disposal
  • Loading branch information
ales-erjavec committed Jun 17, 2020
1 parent c5f8daf commit 19bd4a2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Orange/widgets/utils/concurrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,6 @@ def __cancel_task(self, wait: bool = True):
self._disconnect_signals(state)
if wait:
concurrent.futures.wait([state.future])
state.deleteLater()
else:
w = FutureWatcher(state.future, parent=state)
w.done.connect(state.deleteLater)

def _connect_signals(self, state: TaskState):
state.partial_result_ready.connect(self.on_partial_result)
Expand All @@ -545,8 +541,7 @@ def _on_task_done(self, future: Future):
assert self.__task is not None
assert self.__task.future is future
assert self.__task.watcher.future() is future
self.__task, task = None, self.__task
task.deleteLater()
self.__task = None
ex = future.exception()
if ex is not None:
self.on_exception(ex)
Expand Down

0 comments on commit 19bd4a2

Please sign in to comment.