diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-05 21:56:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-05 21:56:14 +0000 |
commit | 6b0e3e2f544d782b202e56cabee146ddd0fe4cfa (patch) | |
tree | 67ecee00b6c3fbe8eb21144c010ce30ccbc6cd84 /plugins/ChangeKeyboardLayout/src/main.cpp | |
parent | 43ab85f16d5ae026954435a0b206bb0f7550d22f (diff) |
memory leak fix in ChangeKeyboardLayout
git-svn-id: http://svn.miranda-ng.org/main/trunk@7519 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ChangeKeyboardLayout/src/main.cpp')
-rw-r--r-- | plugins/ChangeKeyboardLayout/src/main.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp index 191d2dc9f7..f2ea678b30 100644 --- a/plugins/ChangeKeyboardLayout/src/main.cpp +++ b/plugins/ChangeKeyboardLayout/src/main.cpp @@ -31,7 +31,6 @@ HKL hklEng = (HKL)0x04090409; LPCTSTR ptszSeparators = _T(" \t\n\r");
HANDLE hOptionsInitialize;
-HANDLE hModulesLoaded;
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
@@ -49,25 +48,22 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx);
ZeroMemory(hklLayouts, 20 * sizeof(HKL));
bLayNum = GetKeyboardLayoutList(20,hklLayouts);
- if (bLayNum<2)
+ if (bLayNum < 2)
return 1;
- hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise);
- hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
+
+ HookEvent(ME_OPT_INITIALISE, OnOptionsInitialise);
+ HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
return 0;
}
extern "C" __declspec(dllexport) int Unload(void)
{
- DWORD i;
-
- for (i = 0;i<bLayNum;i++)
+ for (int i = 0; i < bLayNum; i++)
mir_free(ptszLayStrings[i]);
- UnhookEvent(hOptionsInitialize);
- UnhookEvent(hModulesLoaded);
DestroyServiceFunction(hChangeLayout);
DestroyServiceFunction(hGetLayoutOfText);
DestroyServiceFunction(hChangeTextLayout);
UnhookWindowsHookEx(kbHook_All);
return 0;
-}
\ No newline at end of file +}
|