From 451c98173d83ee1618d7923890e803dd7067de40 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 29 Jul 2013 16:41:17 +0000 Subject: resource clearance moved to ME_SYSTEM_PRESHUTDOWN instead of ME_SYSTEM_OKTOEXIT git-svn-id: http://svn.miranda-ng.org/main/trunk@5527 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 43 +++++++++++-------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'plugins/StatusPlugins/KeepStatus/keepstatus.cpp') diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 024b2c5f40..d2f58536bb 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -30,9 +30,6 @@ struct TimerInfo { static CRITICAL_SECTION GenTimerCS, GenStatusCS, CheckContinueslyCS; -static HANDLE hOptionsHook = NULL; -static HANDLE hShutdownHook = NULL; -static HANDLE hAccChangeHook = NULL; static HANDLE hProtoAckHook = NULL; static HANDLE hStatusChangeHook = NULL; static HANDLE hCSStatusChangeHook = NULL; @@ -92,8 +89,6 @@ static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon); LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); -static int Exit(WPARAM wParam, LPARAM lParam); - // options.c extern int OptionsInit(WPARAM wparam,LPARAM); extern int InitCommonStatus(); @@ -1229,27 +1224,8 @@ int OnAccChanged(WPARAM wParam,LPARAM lParam) // =============== init stuff ================= -int CSModuleLoaded(WPARAM,LPARAM) -{ - InitializeCriticalSection(&GenTimerCS); - InitializeCriticalSection(&GenStatusCS); - InitializeCriticalSection(&CheckContinueslyCS); - - protoList = ( OBJLIST* )&connectionSettings; - - hMessageWindow = NULL; - LoadMainOptions(); - hOptionsHook = HookEvent(ME_OPT_INITIALISE, OptionsInit); - hShutdownHook = HookEvent(ME_SYSTEM_OKTOEXIT, Exit); - hAccChangeHook = HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); - return 0; -} - -static int Exit(WPARAM,LPARAM) +static int onShutdown(WPARAM,LPARAM) { - UnhookEvent(hOptionsHook); - UnhookEvent(hShutdownHook); - UnhookEvent(hAccChangeHook); UnhookEvent(hStatusChangeHook); UnhookEvent(hProtoAckHook); UnhookEvent(hCSStatusChangeHook); @@ -1266,3 +1242,20 @@ static int Exit(WPARAM,LPARAM) DeleteCriticalSection(&CheckContinueslyCS); return 0; } + +int CSModuleLoaded(WPARAM,LPARAM) +{ + InitializeCriticalSection(&GenTimerCS); + InitializeCriticalSection(&GenStatusCS); + InitializeCriticalSection(&CheckContinueslyCS); + + protoList = ( OBJLIST* )&connectionSettings; + + hMessageWindow = NULL; + LoadMainOptions(); + + HookEvent(ME_OPT_INITIALISE, OptionsInit); + HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); + HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); + return 0; +} -- cgit v1.2.3