mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Clean up ModuleDLLManager from the Module::cull() method.
This avoids a leak which happens in some rare circumstances.
This commit is contained in:
parent
c0f75dd4f5
commit
8d5adb667f
@ -720,11 +720,9 @@ class ReloadAction : public ActionBase
|
||||
ReloadModule::DataKeeper datakeeper;
|
||||
datakeeper.Save(mod);
|
||||
|
||||
DLLManager* dll = mod->ModuleDLLManager;
|
||||
std::string name = mod->ModuleSourceFile;
|
||||
ServerInstance->Modules->DoSafeUnload(mod);
|
||||
ServerInstance->GlobalCulls.Apply();
|
||||
delete dll;
|
||||
bool result = ServerInstance->Modules->Load(name);
|
||||
|
||||
if (result)
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user