summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-09-18 18:33:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-09-18 18:33:09 +0300
commit3e9e96f6718b13c069138fb40f24f065ac03c6b7 (patch)
treed09301e8d63cf2bc70601fe683992440d4e2e086 /plugins/StatusManager/src
parentb5de62080a2384e9f66d7bafbf971aa5b4b7c0c1 (diff)
unneeded calls of DestroyServiceFunction() removed
Diffstat (limited to 'plugins/StatusManager/src')
-rw-r--r--plugins/StatusManager/src/KeepStatus/keepstatus.cpp24
-rw-r--r--plugins/StatusManager/src/StartupStatus/ss_profiles.cpp15
-rw-r--r--plugins/StatusManager/src/StartupStatus/startupstatus.cpp20
-rw-r--r--plugins/StatusManager/src/StartupStatus/startupstatus.h1
4 files changed, 12 insertions, 48 deletions
diff --git a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp
index 1cc209f0c7..01b63728a0 100644
--- a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp
@@ -32,12 +32,7 @@ struct TimerInfo {
HANDLE hMainThread = 0;
unsigned long mainThreadId = 0;
-HANDLE hKSModuleLoadedHook = NULL,
- hConnectionEvent = NULL,
- hStopRecon = NULL,
- hEnableProto = NULL,
- hIsProtoEnabled = NULL,
- hAnnounceStat = NULL;
+HANDLE hConnectionEvent = NULL;
static mir_cs GenTimerCS, GenStatusCS, CheckContinueslyCS;
@@ -1219,14 +1214,14 @@ void KeepStatusLoad()
MUUID muidLast = MIID_LAST;
hKSLangpack = GetPluginLangId(muidLast, 0);
- hKSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, KSModuleLoaded);
+ HookEvent(ME_SYSTEM_MODULESLOADED, KSModuleLoaded);
CreateHookableEvent(ME_KS_CONNECTIONEVENT);
- hStopRecon = CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService);
- hEnableProto = CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService);
- hIsProtoEnabled = CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService);
- hAnnounceStat = CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService);
+ CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService);
+ CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService);
+ CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService);
+ CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
mainThreadId = GetCurrentThreadId();
@@ -1237,12 +1232,5 @@ void KeepStatusUnload()
if (hMainThread)
CloseHandle(hMainThread);
- DestroyServiceFunction(hStopRecon);
- DestroyServiceFunction(hEnableProto);
- DestroyServiceFunction(hIsProtoEnabled);
- DestroyServiceFunction(hAnnounceStat);
-
DestroyHookableEvent(hConnectionEvent);
-
- UnhookEvent(hKSModuleLoadedHook);
}
diff --git a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
index 5cb311b605..4dad85be05 100644
--- a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
+++ b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp
@@ -25,7 +25,6 @@ extern HINSTANCE hInst;
extern int protoCount;
static int menuprofiles[MAX_MMITEMS];
-static HANDLE hProfileServices[MAX_MMITEMS];
static int mcount = 0;
static PROFILECE *pce = NULL;
@@ -34,7 +33,6 @@ static int pceCount = 0;
static UINT_PTR releaseTtbTimerId = 0;
static HANDLE hTBModuleLoadedHook;
-static HANDLE hLoadAndSetProfileService;
static HANDLE hMessageHook = NULL;
static HWND hMessageWindow = NULL;
@@ -72,7 +70,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM)
char servicename[128];
mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount);
- hProfileServices[mcount] = CreateServiceFunctionParam(servicename, profileService, mcount);
+ CreateServiceFunctionParam(servicename, profileService, mcount);
mi.name.w = profilename;
mi.position = 2000100000 + mcount;
@@ -310,13 +308,7 @@ int SSLoadMainOptions()
int LoadProfileModule()
{
- hLoadAndSetProfileService = CreateServiceFunction(MS_SS_LOADANDSETPROFILE, LoadAndSetProfile);
- return 0;
-}
-
-int UnloadProfileModule()
-{
- DestroyServiceFunction(hLoadAndSetProfileService);
+ CreateServiceFunction(MS_SS_LOADANDSETPROFILE, LoadAndSetProfile);
return 0;
}
@@ -333,9 +325,6 @@ int InitProfileModule()
int DeinitProfilesModule()
{
- for (int i = 0; i < mcount; i++)
- DestroyServiceFunction(hProfileServices[i]);
-
if (pce) {
for (int i = 0; i < pceCount; i++)
free(pce[i].szProto);
diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp
index 7376d1a03c..442c707f9d 100644
--- a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp
+++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp
@@ -480,11 +480,6 @@ int SSModuleLoaded(WPARAM, LPARAM)
return 0;
}
-HANDLE hSSModuleLoadedHook = NULL,
- hGetProfileService,
- hGetProfileCountService,
- hGetProfileNameService;
-
static INT_PTR SrvGetProfile(WPARAM wParam, LPARAM lParam)
{
return GetProfile((int)wParam, *(TSettingsList*)lParam);
@@ -495,7 +490,7 @@ void StartupStatusLoad()
MUUID muidLast = MIID_LAST;
hSSLangpack = GetPluginLangId(muidLast, 0);
- hSSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, SSModuleLoaded);
+ HookEvent(ME_SYSTEM_MODULESLOADED, SSModuleLoaded);
if (db_get_b(NULL, SSMODULENAME, SETTING_SETPROFILE, 1) ||
db_get_b(NULL, SSMODULENAME, SETTING_OFFLINECLOSE, 0))
@@ -511,9 +506,9 @@ void StartupStatusLoad()
}
// Create service functions; the get functions are created here; they don't rely on commonstatus
- hGetProfileService = CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile);
- hGetProfileCountService = CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount);
- hGetProfileNameService = CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName);
+ CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile);
+ CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount);
+ CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName);
LoadProfileModule();
}
@@ -524,11 +519,4 @@ void StartupStatusUnload()
KillModuleMenus(hSSLangpack);
DeinitProfilesModule();
- UnloadProfileModule();
-
- DestroyServiceFunction(hGetProfileService);
- DestroyServiceFunction(hGetProfileCountService);
- DestroyServiceFunction(hGetProfileNameService);
-
- UnhookEvent(hSSModuleLoadedHook);
}
diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.h b/plugins/StatusManager/src/StartupStatus/startupstatus.h
index 5d04c24cf5..9dd738c346 100644
--- a/plugins/StatusManager/src/StartupStatus/startupstatus.h
+++ b/plugins/StatusManager/src/StartupStatus/startupstatus.h
@@ -154,7 +154,6 @@ void RemoveTopToolbarButtons();
int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam);
int LoadProfileModule();
-int UnloadProfileModule();
int InitProfileModule();
int DeinitProfilesModule();