Skip to content

Commit

Permalink
Revert "Don't rely on the _entities dictionary in the Entity finalizer."
Browse files Browse the repository at this point in the history
This reverts commit 54b9002.
  • Loading branch information
willstott101 committed Aug 23, 2022
1 parent 40cf316 commit fa3bb98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyclonedds/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ def __init__(self, ref: int, listener: "Listener" = None) -> None:
self._listener = listener

def __del__(self) -> None:
if not hasattr(self, "_ref"):
if not hasattr(self, "_ref") or self._ref not in self._entities:
return

self._entities.pop(self._ref, None)
del self._entities[self._ref]
self._delete(self._ref)

def get_subscriber(self) -> Optional["cyclonedds.sub.Subscriber"]:
Expand Down

0 comments on commit fa3bb98

Please sign in to comment.