From 6fc147b62bfbcb9314316ce73671024b097e810d Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 14 Jul 2020 22:20:04 +0100 Subject: [PATCH] Make sure references to penguin object are expunged by gc --- houdini/cooldown.py | 2 +- houdini/data/room.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/houdini/cooldown.py b/houdini/cooldown.py index 6b95797..13bee69 100644 --- a/houdini/cooldown.py +++ b/houdini/cooldown.py @@ -67,7 +67,7 @@ class _CooldownMapping: def _get_bucket_key(self, p): if self._cooldown.bucket_type == BucketType.Default: - return p + return p.id return p.server def _verify_cache_integrity(self): diff --git a/houdini/data/room.py b/houdini/data/room.py index 028d624..dd92e12 100644 --- a/houdini/data/room.py +++ b/houdini/data/room.py @@ -96,6 +96,8 @@ class PenguinBackyardRoom(RoomMixin): await p.send_xt('jr', self.id, await p.string) async def remove_penguin(self, p): + self.penguin = None + p.room = None p.frame = 1 p.toy = None