From 05898f5b8b7c3e98a026f1a34edd3e0e46048c66 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sat, 16 May 2020 16:23:31 +0200 Subject: [PATCH] Added __del__ method --- src/game/Map.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/Map.py b/src/game/Map.py index 503239d..f39d854 100644 --- a/src/game/Map.py +++ b/src/game/Map.py @@ -240,3 +240,8 @@ class Map: if b.rect.x == x and b.rect.y == y: return True return False + + def __del__(self): + for entity in self.entities.sprites(): + entity.kill() + del entity