summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/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/AutoShutdown/src
parentb5de62080a2384e9f66d7bafbf971aa5b4b7c0c1 (diff)
unneeded calls of DestroyServiceFunction() removed
Diffstat (limited to 'plugins/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/main.cpp1
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp16
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.h1
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp10
4 files changed, 5 insertions, 23 deletions
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp
index 4da45e527e..2d68004d38 100644
--- a/plugins/AutoShutdown/src/main.cpp
+++ b/plugins/AutoShutdown/src/main.cpp
@@ -92,7 +92,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
UninitOptions();
- UninitSettingsDlg(); /* before UninitWatcher() */
UninitWatcher(); /* before UninitFrame() */
UninitFrame();
UninitShutdownSvc();
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 58e3911e07..15bcc187c5 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -21,11 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-/* Menu Item */
-static HANDLE hServiceMenuCommand;
-
/* Services */
-static HANDLE hServiceShowDlg;
static HWND hwndSettingsDlg;
extern HINSTANCE hInst;
@@ -482,20 +478,12 @@ static INT_PTR MenuItemCommand(WPARAM, LPARAM)
void InitSettingsDlg(void)
{
/* Menu Item */
- hServiceMenuCommand = CreateServiceFunction("AutoShutdown/MenuCommand", MenuItemCommand);
+ CreateServiceFunction("AutoShutdown/MenuCommand", MenuItemCommand);
hMainMenuItem = hTrayMenuItem = NULL;
SetShutdownMenuItem(false);
/* Hotkey */
AddHotkey();
/* Services */
hwndSettingsDlg = NULL;
- hServiceShowDlg = CreateServiceFunction(MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG, ServiceShowSettingsDialog);
-}
-
-void UninitSettingsDlg(void)
-{
- /* Menu Item */
- DestroyServiceFunction(hServiceMenuCommand);
- /* Services */
- DestroyServiceFunction(hServiceShowDlg);
+ CreateServiceFunction(MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG, ServiceShowSettingsDialog);
}
diff --git a/plugins/AutoShutdown/src/settingsdlg.h b/plugins/AutoShutdown/src/settingsdlg.h
index 87f9e6a9f9..1521812f30 100644
--- a/plugins/AutoShutdown/src/settingsdlg.h
+++ b/plugins/AutoShutdown/src/settingsdlg.h
@@ -27,5 +27,4 @@ void SetShutdownToolbarButton(bool fActive);
/* Misc */
void InitSettingsDlg(void);
-void UninitSettingsDlg(void);
int ToolbarLoaded(WPARAM,LPARAM);
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 791278c898..d5422b632f 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -32,7 +32,6 @@ static HANDLE hHookSettingChanged;
/* Weather Shutdown */
static HANDLE hHookWeatherUpdated;
/* Services */
-static HANDLE hServiceStartWatcher, hServiceStopWatcher, hServiceIsEnabled;
static HANDLE hEventWatcherChanged;
/* Misc */
static HANDLE hHookModulesLoaded;
@@ -342,9 +341,9 @@ void InitWatcher(void)
hHookWeatherUpdated = NULL;
/* Services */
hEventWatcherChanged = CreateHookableEvent(ME_AUTOSHUTDOWN_WATCHERCHANGED);
- hServiceStartWatcher = CreateServiceFunction(MS_AUTOSHUTDOWN_STARTWATCHER, ServiceStartWatcher);
- hServiceStopWatcher = CreateServiceFunction(MS_AUTOSHUTDOWN_STOPWATCHER, ServiceStopWatcher);
- hServiceIsEnabled = CreateServiceFunction(MS_AUTOSHUTDOWN_ISWATCHERENABLED, ServiceIsWatcherEnabled);
+ CreateServiceFunction(MS_AUTOSHUTDOWN_STARTWATCHER, ServiceStartWatcher);
+ CreateServiceFunction(MS_AUTOSHUTDOWN_STOPWATCHER, ServiceStopWatcher);
+ CreateServiceFunction(MS_AUTOSHUTDOWN_ISWATCHERENABLED, ServiceIsWatcherEnabled);
}
void UninitWatcher(void)
@@ -366,9 +365,6 @@ void UninitWatcher(void)
/* Weather Shutdown */
UnhookEvent(hHookWeatherUpdated); /* does NULL check */
/* Services */
- DestroyServiceFunction(hServiceStartWatcher);
- DestroyServiceFunction(hServiceStopWatcher);
- DestroyServiceFunction(hServiceIsEnabled);
DestroyHookableEvent(hEventWatcherChanged);
/* Misc */
UnhookEvent(hHookModulesLoaded);