From 9de0202a0b12838d505825413c3cbcce5edabc11 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Mar 2013 22:12:20 +0000 Subject: cleanup of the unnecessary UnhookEvent() calls git-svn-id: http://svn.miranda-ng.org/main/trunk@3909 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AuthState/src/main.cpp | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'plugins/AuthState') diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 1c41ecd299..16fba6994f 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -20,11 +20,10 @@ #include "commonheaders.h" HINSTANCE g_hInst; -static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL; -static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL; -static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL; -static HANDLE hUserMenu = NULL; -HANDLE hExtraIcon = NULL; +static HANDLE hOptInitialise; +static HANDLE hHookExtraIconsRebuild, hHookExtraIconsApply; +static HANDLE hAuthMenuSelected, hUserMenu; +HANDLE hExtraIcon; int hLangpack; BYTE bUseAuthIcon = 0, bUseGrantIcon = 0, bContactMenuItem = 0, bIconsForRecentContacts = 0, bUseAuthGroup = 0; @@ -186,28 +185,15 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) } hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise); - if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); + if (bContactMenuItem) + HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); return 0; } int onSystemOKToExit(WPARAM wParam,LPARAM lParam) { - UnhookEvent(hHookModulesLoaded); - UnhookEvent(hHookExtraIconsRebuild); - UnhookEvent(hHookExtraIconsApply); - UnhookEvent(hOptInitialise); - UnhookEvent(hSystemOKToExit); - UnhookEvent(hContactSettingChanged); - if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged); - if (hContactAdded) UnhookEvent(hContactAdded); - if (hPrebuildContactMenu) - { - UnhookEvent(hPrebuildContactMenu); - UnhookEvent(hUserMenu); - } DestroyServiceFunction(hAuthMenuSelected); - return 0; } @@ -215,16 +201,16 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); - hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); - hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); - hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); + HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); + HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); + HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); bUseAuthIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", 1); bUseGrantIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", 1); bContactMenuItem = DBGetContactSettingByte(NULL, MODULENAME, "MenuItem", 0); bIconsForRecentContacts = DBGetContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", 0); - hContactAdded = HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); + HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); if (bContactMenuItem) { -- cgit v1.2.3