Skip to content

Commit

Permalink
clear all event callbacks on close
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Jan 28, 2021
1 parent 1ccd44c commit e0596e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plumpy/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ def _setup_event_hooks(self) -> None:
}
for hook, callback in event_hooks.items():
self.add_state_event_callback(hook, callback)
self.add_cleanup(functools.partial(self.remove_state_event_callback, hook, callback))

@property
def creation_time(self) -> Optional[float]:
Expand Down Expand Up @@ -845,6 +844,7 @@ def on_close(self) -> None:
self.logger.exception('Exception calling cleanup method %s', cleanup)
self._cleanups = None
finally:
self._event_callbacks = {}
self._closed = True

def _fire_event(self, evt: Callable[..., Any], *args: Any, **kwargs: Any) -> None:
Expand Down

0 comments on commit e0596e5

Please sign in to comment.