diff options
author | George Hazan <ghazan@miranda.im> | 2018-08-27 16:39:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-08-27 16:39:46 +0300 |
commit | 23eaad0f22903eee75a4996203ab875e567802b6 (patch) | |
tree | 9ad39eb5ce42d63a8c5c1cb6920e07348f67a622 | |
parent | bae985cd619792221e9e5febe53037bdf2156da5 (diff) |
CMPlugin resource cleaning moved to the destructor of CMPluginBase
-rw-r--r-- | src/mir_app/src/CMPluginBase.cpp | 14 | ||||
-rw-r--r-- | src/mir_app/src/newplugins.cpp | 12 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index e377e1c43a..4d8a27f48c 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -121,6 +121,20 @@ CMPluginBase::CMPluginBase(const char *moduleName, const PLUGININFOEX &pInfo) : CMPluginBase::~CMPluginBase() { + if (!g_bMirandaTerminated) { + KillModuleMenus(this); + KillModuleFonts(this); + KillModuleColours(this); + KillModuleEffects(this); + KillModuleIcons(this); + KillModuleHotkeys(this); + KillModuleSounds(this); + KillModuleExtraIcons(this); + KillModuleSrmmIcons(this); + KillModuleToolbarIcons(this); + KillModuleOptions(this); + } + if (m_hLogger) { mir_closeLog(m_hLogger); m_hLogger = nullptr; diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index b90f79d727..d29a8914e4 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -275,18 +275,6 @@ bool Plugin_UnloadDyn(pluginEntry *p) KillModuleServices(hInst);
}
- KillModuleMenus(ppb);
- KillModuleFonts(ppb);
- KillModuleColours(ppb);
- KillModuleEffects(ppb);
- KillModuleIcons(ppb);
- KillModuleHotkeys(ppb);
- KillModuleSounds(ppb);
- KillModuleExtraIcons(ppb);
- KillModuleSrmmIcons(ppb);
- KillModuleToolbarIcons(ppb);
- KillModuleOptions(ppb);
-
NotifyFastHook(hevUnloadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
// mark default plugins to be loaded
|