From 8d5adb667fcdf05dc87b1091359b66ae7e12d090 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 14 Feb 2020 01:25:09 +0000 Subject: Clean up ModuleDLLManager from the Module::cull() method. This avoids a leak which happens in some rare circumstances. --- src/modules.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 2bb594a57..73bd2a5e2 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -64,6 +64,8 @@ Module::Module() CullResult Module::cull() { + if (ModuleDLLManager) + ServerInstance->GlobalCulls.AddItem(ModuleDLLManager); return classbase::cull(); } @@ -450,11 +452,8 @@ namespace UnloadAction(Module* m) : mod(m) {} void Call() CXX11_OVERRIDE { - DLLManager* dll = mod->ModuleDLLManager; ServerInstance->Modules->DoSafeUnload(mod); ServerInstance->GlobalCulls.Apply(); - // In pure static mode this is always NULL - delete dll; ServerInstance->GlobalCulls.AddItem(this); } }; -- cgit v1.3.1-10-gc9f91