summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src/StartupStatus
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/StartupStatus
parentb5de62080a2384e9f66d7bafbf971aa5b4b7c0c1 (diff)
unneeded calls of DestroyServiceFunction() removed
Diffstat (limited to 'plugins/StatusManager/src/StartupStatus')
-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
3 files changed, 6 insertions, 30 deletions
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();