Skip to content

Commit

Permalink
Merge pull request #133 from willstott101/bugfix/revert-circles
Browse files Browse the repository at this point in the history
Revert "Don't rely on the _entities dictionary in the Entity finalizer."
  • Loading branch information
thijsmie authored Aug 23, 2022
2 parents 40cf316 + fa3bb98 commit 65cb2aa
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 65cb2aa

Please sign in to comment.