From 49b7106d7151c61c6a44977ee31558e1151abb66 Mon Sep 17 00:00:00 2001 From: rikka Date: Tue, 3 Dec 2024 22:39:56 +0800 Subject: [PATCH] fix: Memory leak caused by scanp command due to handler's reference to plugin instance. close #2412 --- plugins/plugin_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/plugin_manager.py b/plugins/plugin_manager.py index cecf75d6..8eb74875 100644 --- a/plugins/plugin_manager.py +++ b/plugins/plugin_manager.py @@ -151,6 +151,8 @@ class PluginManager: self.disable_plugin(name) failed_plugins.append(name) continue + if name in self.instances: + self.instances[name].handlers.clear() self.instances[name] = instance for event in instance.handlers: if event not in self.listening_plugins: