From ccf94b57eb7d7bf271395a896cc7edc8ae1ec069 Mon Sep 17 00:00:00 2001 From: trojvn Date: Sat, 7 Mar 2026 14:02:47 +0300 Subject: [PATCH] fix(process): remove client reference after disconnection Remove the client reference from the ProcessThon class after disconnection to prevent potential memory leaks and ensure proper cleanup of resources. This change ensures that the client object is dereferenced and garbage collected after the disconnection process is completed. --- thon/process.py | 1 + 1 file changed, 1 insertion(+) diff --git a/thon/process.py b/thon/process.py index f38c3fe..17a7e83 100644 --- a/thon/process.py +++ b/thon/process.py @@ -173,6 +173,7 @@ class ProcessThon(Data): await self.client(UpdateStatusRequest(offline=True)) with contextlib.suppress(Exception): await self.client.disconnect() # type: ignore # ty:ignore[unused-ignore-comment] + del self.__client async def __aenter__(self) -> Self | str: r = await self.check()