From 714dd92f35b6f4c2dc1c332e89535cc167493b8d Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Wed, 8 Nov 2023 18:57:56 +0100 Subject: [PATCH] allow multiple calls to Message.close() --- CHANGELOG.md | 1 + app/src/messages.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12bb9cb..b774e3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - add int64 data type to info parser +- allow multiple calls to Message.close() ## [0.5.1] - 2023-11-05 diff --git a/app/src/messages.py b/app/src/messages.py index 77d2742..96574c7 100644 --- a/app/src/messages.py +++ b/app/src/messages.py @@ -110,7 +110,7 @@ class Message(metaclass=IterRegistry): # we have refernces to methods of this class in self.switch # so we have to erase self.switch, otherwise this instance can't be # deallocated by the garbage collector ==> we get a memory leak - del self.switch + self.switch.clear() def inc_counter(self, counter: str) -> None: self.db.inc_counter(counter)