diff options
author | George Hazan <george.hazan@gmail.com> | 2013-01-23 17:26:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-01-23 17:26:06 +0000 |
commit | ac9cc8dd9bb65882a77b93a35448be62c3f83fef (patch) | |
tree | e64aaadc43c10c416999c103e31e9b479dd0c67d /plugins/SeenPlugin/src/main.cpp | |
parent | 6ae828fd5f3a53279911da31891f5ccc82a8b975 (diff) |
- GDI resource leak fix;
- various cosmetics
git-svn-id: http://svn.miranda-ng.org/main/trunk@3252 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SeenPlugin/src/main.cpp')
-rw-r--r-- | plugins/SeenPlugin/src/main.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 9280f550ad..9dea392cfd 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -26,7 +26,7 @@ Last change by : $Author: y_b $ #include "version.h"
HINSTANCE hInstance;
-HANDLE ehdb = NULL, ehproto = NULL, ehmissed = NULL, ehuserinfo = NULL, ehmissed_proto = NULL, hOptInit = NULL, hMainInit = NULL;
+HANDLE ehmissed = NULL, ehuserinfo = NULL, ehmissed_proto = NULL;
int hLangpack;
@@ -60,7 +60,7 @@ int MainInit(WPARAM wparam,LPARAM lparam) memset(&contactQueue[0], 0, contactQueueSize);
contactQueueSize = 16;
includeIdle = (BOOL )db_get_b(NULL,S_MOD,"IdleSupport",1);
- hOptInit = HookEvent(ME_OPT_INITIALISE, OptionsInit);
+ HookEvent(ME_OPT_INITIALISE, OptionsInit);
if ( db_get_b(NULL,S_MOD,"MenuItem",1))
InitMenuitem();
@@ -72,10 +72,10 @@ int MainInit(WPARAM wparam,LPARAM lparam) InitFileOutput();
if ( db_get_b(NULL,S_MOD,"MissedOnes",0))
- ehmissed_proto=HookEvent(ME_PROTO_ACK,ModeChange_mo);
+ ehmissed_proto = HookEvent(ME_PROTO_ACK,ModeChange_mo);
- ehdb = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UpdateValues);
- ehproto = HookEvent(ME_PROTO_ACK,ModeChange);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, UpdateValues);
+ HookEvent(ME_PROTO_ACK,ModeChange);
SkinAddNewSoundExT("LastSeenTrackedStatusChange", LPGENT("LastSeen"), LPGENT("User status change"));
SkinAddNewSoundExT("LastSeenTrackedStatusOnline", LPGENT("LastSeen"), LPGENT("Changed to Online"));
@@ -88,11 +88,9 @@ int MainInit(WPARAM wparam,LPARAM lparam) db_set_s(NULL,"Uninstall",Translate("Last seen"),S_MOD);
- if ( ServiceExists(MS_TIPPER_ADDTRANSLATION)) {
- int i;
- for (i=0; i < TRANSNUMBER; i++)
+ if ( ServiceExists(MS_TIPPER_ADDTRANSLATION))
+ for (int i=0; i < TRANSNUMBER; i++)
CallService(MS_TIPPER_ADDTRANSLATION, 0, (LPARAM)&idleTr[i]);
- }
return 0;
}
@@ -104,15 +102,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirand extern "C" __declspec(dllexport) int Unload(void)
{
- UnhookEvent(ehdb);
- if (ehmissed) UnhookEvent(ehmissed);
- UnhookEvent(ehproto);
- if (ehmissed_proto) UnhookEvent(ehmissed_proto);
- UnhookEvent(hOptInit);
- UnhookEvent(hMainInit);
- if (ehuserinfo) UnhookEvent(ehuserinfo);
+ if (ehmissed)
+ UnhookEvent(ehmissed);
+
UninitMenuitem();
-// free(contactQueue);
return 0;
}
@@ -131,6 +124,6 @@ extern "C" __declspec(dllexport) int Load(void) // I decided to hook all events after
// everything is loaded because it seems
// to be safer in my opinion
- hMainInit = HookEvent(ME_SYSTEM_MODULESLOADED,MainInit);
+ HookEvent(ME_SYSTEM_MODULESLOADED,MainInit);
return 0;
}
\ No newline at end of file |