summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/main.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-05-20 17:24:28 +0300
committeraunsane <aunsane@gmail.com>2018-05-20 17:24:47 +0300
commitcf39a24da2375575d0f93b95c7ae258aae1658a7 (patch)
treebdb74cfc48c3b8947306cda063c88d8411039b52 /plugins/MirLua/src/main.cpp
parent9eda23f5d0d4d239bd46a2da66bf4ff141dc3ad0 (diff)
MirLua: no need to keep two instances of CMPlugin
Diffstat (limited to 'plugins/MirLua/src/main.cpp')
-rw-r--r--plugins/MirLua/src/main.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/MirLua/src/main.cpp b/plugins/MirLua/src/main.cpp
index f65f6293ad..b38ed43347 100644
--- a/plugins/MirLua/src/main.cpp
+++ b/plugins/MirLua/src/main.cpp
@@ -3,8 +3,6 @@
int &hLangpack(g_plugin.m_hLang);
CMPlugin g_plugin;
-CMLua *g_mLua;
-
HANDLE g_hCLibsFolder;
HANDLE g_hScriptsFolder;
@@ -27,9 +25,9 @@ PLUGININFOEX pluginInfoEx =
};
-CMPlugin::CMPlugin() :
+/*CMPlugin::CMPlugin() :
PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
-{}
+{}*/
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
@@ -46,7 +44,7 @@ int OnOptionsInit(WPARAM wParam, LPARAM)
odp.szGroup.w = LPGENW("Services");
odp.szTitle.w = L"Lua";
odp.szTab.w = LPGENW("Scripts");
- odp.pDialog = new CMLuaOptions(g_mLua);
+ odp.pDialog = new CMLuaOptions();
Options_AddPage(wParam, &odp);
return 0;
}
@@ -75,8 +73,7 @@ extern "C" int __declspec(dllexport) Load(void)
hRecvMessage = CreateHookableEvent(MODULENAME PSR_MESSAGE);
CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, FilterRecvMessage);
- g_mLua = new CMLua();
- g_mLua->Load();
+ g_plugin.Load();
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
return 0;
@@ -86,7 +83,7 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
- delete g_mLua;
+ g_plugin.Unload();
if (hNetlib) {
Netlib_CloseHandle(hNetlib);