8000 Ignore all exceptions when removing listeners · steeltrack/AbletonOSC@2c27b6c · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Ignore all exceptions when removing listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Jan 1, 2024
1 parent ecc70c4 commit 2c27b6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions abletonosc/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ def _stop_listen(self, target, prop, params: Optional[Tuple[Any]] = ()) -> None:
remove_listener_function = getattr(target, remove_listener_function_name)
try:
remove_listener_function(listener_function)
except RuntimeError:
except Exception as e:
#--------------------------------------------------------------------------------
# This exception may be thrown when an observer is no longer connected --
# e.g., when trying to stop listening for a clip property of a clip that has been deleted.
# Ignore as it is benign.
#--------------------------------------------------------------------------------
pass
self.logger.info("Exception whilst removing listener (likely benign): %s" % e)

del self.listener_functions[listener_key]
del self.listener_objects[listener_key]
else:
Expand Down

0 comments on commit 2c27b6c

Please sign in to comment.
0